Chris Lu
11 years ago
9 changed files with 119 additions and 34 deletions
-
16go/filer/directory_in_map.go
-
16go/filer/directory_test.go
-
2go/filer/filer.go
-
33go/filer/filer_embedded.go
-
7go/filer/files_in_leveldb.go
-
1go/weed/weed_server/filer_server.go
-
28go/weed/weed_server/filer_server_handlers_admin.go
-
2go/weed/weed_server/master_server_handlers_admin.go
@ -0,0 +1,28 @@ |
|||
package weed_server |
|||
|
|||
import ( |
|||
"code.google.com/p/weed-fs/go/glog" |
|||
"net/http" |
|||
) |
|||
|
|||
/* |
|||
Move a folder or a file, with 4 Use cases: |
|||
mv fromDir toNewDir |
|||
mv fromDir toOldDir |
|||
mv fromFile toDir |
|||
mv fromFile toFile |
|||
|
|||
Wildcard is not supported. |
|||
|
|||
*/ |
|||
func (fs *FilerServer) moveHandler(w http.ResponseWriter, r *http.Request) { |
|||
from := r.FormValue("from") |
|||
to := r.FormValue("to") |
|||
err := fs.filer.Move(from, to) |
|||
if err != nil { |
|||
glog.V(4).Infoln("moving", from, "->", to, err.Error()) |
|||
writeJsonError(w, r, err) |
|||
} else { |
|||
w.WriteHeader(http.StatusOK) |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue