mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add back recursively delete a folder
This commit is contained in:
parent
57ded4fd80
commit
e4b7e31902
|
@ -223,9 +223,12 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// curl -X DELETE http://localhost:8888/path/to
|
// curl -X DELETE http://localhost:8888/path/to
|
||||||
|
// curl -X DELETE http://localhost:8888/path/to?recursive=true
|
||||||
func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
err := fs.filer.DeleteEntryMetaAndData(filer2.FullPath(r.URL.Path), false, true)
|
isRecursive := r.FormValue("recursive") == "true"
|
||||||
|
|
||||||
|
err := fs.filer.DeleteEntryMetaAndData(filer2.FullPath(r.URL.Path), isRecursive, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.V(1).Infoln("deleting", r.URL.Path, ":", err.Error())
|
glog.V(1).Infoln("deleting", r.URL.Path, ":", err.Error())
|
||||||
writeJsonError(w, r, http.StatusInternalServerError, err)
|
writeJsonError(w, r, http.StatusInternalServerError, err)
|
||||||
|
|
Loading…
Reference in a new issue