mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactor(webdav_server): modifiledTime
-> modifiedTime
(#3676)
Signed-off-by: Ryan Russell <git@ryanrussell.org> Signed-off-by: Ryan Russell <git@ryanrussell.org>
This commit is contained in:
parent
d5239ab983
commit
3429cbe3fc
|
@ -84,14 +84,14 @@ type FileInfo struct {
|
||||||
name string
|
name string
|
||||||
size int64
|
size int64
|
||||||
mode os.FileMode
|
mode os.FileMode
|
||||||
modifiledTime time.Time
|
modifiedTime time.Time
|
||||||
isDirectory bool
|
isDirectory bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fi *FileInfo) Name() string { return fi.name }
|
func (fi *FileInfo) Name() string { return fi.name }
|
||||||
func (fi *FileInfo) Size() int64 { return fi.size }
|
func (fi *FileInfo) Size() int64 { return fi.size }
|
||||||
func (fi *FileInfo) Mode() os.FileMode { return fi.mode }
|
func (fi *FileInfo) Mode() os.FileMode { return fi.mode }
|
||||||
func (fi *FileInfo) ModTime() time.Time { return fi.modifiledTime }
|
func (fi *FileInfo) ModTime() time.Time { return fi.modifiedTime }
|
||||||
func (fi *FileInfo) IsDir() bool { return fi.isDirectory }
|
func (fi *FileInfo) IsDir() bool { return fi.isDirectory }
|
||||||
func (fi *FileInfo) Sys() interface{} { return nil }
|
func (fi *FileInfo) Sys() interface{} { return nil }
|
||||||
|
|
||||||
|
@ -356,11 +356,11 @@ func (fs *WebDavFileSystem) stat(ctx context.Context, fullFilePath string) (os.F
|
||||||
fi.size = int64(filer.FileSize(entry))
|
fi.size = int64(filer.FileSize(entry))
|
||||||
fi.name = string(fullpath)
|
fi.name = string(fullpath)
|
||||||
fi.mode = os.FileMode(entry.Attributes.FileMode)
|
fi.mode = os.FileMode(entry.Attributes.FileMode)
|
||||||
fi.modifiledTime = time.Unix(entry.Attributes.Mtime, 0)
|
fi.modifiedTime = time.Unix(entry.Attributes.Mtime, 0)
|
||||||
fi.isDirectory = entry.IsDirectory
|
fi.isDirectory = entry.IsDirectory
|
||||||
|
|
||||||
if fi.name == "/" {
|
if fi.name == "/" {
|
||||||
fi.modifiledTime = time.Now()
|
fi.modifiedTime = time.Now()
|
||||||
fi.isDirectory = true
|
fi.isDirectory = true
|
||||||
}
|
}
|
||||||
return &fi, nil
|
return &fi, nil
|
||||||
|
@ -546,7 +546,7 @@ func (f *WebDavFile) Readdir(count int) (ret []os.FileInfo, err error) {
|
||||||
size: int64(filer.FileSize(entry)),
|
size: int64(filer.FileSize(entry)),
|
||||||
name: entry.Name,
|
name: entry.Name,
|
||||||
mode: os.FileMode(entry.Attributes.FileMode),
|
mode: os.FileMode(entry.Attributes.FileMode),
|
||||||
modifiledTime: time.Unix(entry.Attributes.Mtime, 0),
|
modifiedTime: time.Unix(entry.Attributes.Mtime, 0),
|
||||||
isDirectory: entry.IsDirectory,
|
isDirectory: entry.IsDirectory,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue