fix directory creation, directory listing

This commit is contained in:
Chris Lu
2018-05-19 12:07:15 -07:00
parent e31c514b00
commit ab4ddb1e0e
4 changed files with 17 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ func (fs *FilerServer) registerHandler(w http.ResponseWriter, r *http.Request) {
fileId := r.FormValue("fileId")
fileSize, err := strconv.ParseUint(r.FormValue("fileSize"), 10, 64)
if err != nil {
glog.V(4).Infof("register %s to %s parse fileSize %s: %v", fileId, path, r.FormValue("fileSize"), err)
glog.V(0).Infof("register %s to %s parse fileSize %s: %v", fileId, path, r.FormValue("fileSize"), err)
writeJsonError(w, r, http.StatusInternalServerError, err)
return
}
@@ -30,6 +30,7 @@ func (fs *FilerServer) registerHandler(w http.ResponseWriter, r *http.Request) {
Mtime: time.Now().UnixNano(),
}},
}
glog.V(2).Infof("register %s to %s parse fileSize %s", fileId, path, r.FormValue("fileSize"))
err = fs.filer.CreateEntry(entry)
if err != nil {
glog.V(4).Infof("register %s to %s error: %v", fileId, path, err)

View File

@@ -48,6 +48,8 @@ func (fs *FilerServer) listDirectoryHandler(w http.ResponseWriter, r *http.Reque
lastFileName = entries[len(entries)-1].Name()
}
glog.V(4).Infof("listDirectory %s, last file %s, limit %d: %d items", path, lastFileName, limit, len(entries))
args := struct {
Path string
Entries interface{}