add mime, use simple insert and update filer store API
1. add mime type to file in filer 2. purge old chunks if overwrite during insert
This commit is contained in:
@@ -56,13 +56,9 @@ func (store *MemDbStore) FindEntry(fullpath filer2.FullPath) (entry *filer2.Entr
|
||||
return entry, nil
|
||||
}
|
||||
|
||||
func (store *MemDbStore) DeleteEntry(fullpath filer2.FullPath) (entry *filer2.Entry, err error) {
|
||||
item := store.tree.Delete(entryItem{&filer2.Entry{FullPath: fullpath}})
|
||||
if item == nil {
|
||||
return nil, nil
|
||||
}
|
||||
entry = item.(entryItem).Entry
|
||||
return entry, nil
|
||||
func (store *MemDbStore) DeleteEntry(fullpath filer2.FullPath) (err error) {
|
||||
store.tree.Delete(entryItem{&filer2.Entry{FullPath: fullpath}})
|
||||
return nil
|
||||
}
|
||||
|
||||
func (store *MemDbStore) ListDirectoryEntries(fullpath filer2.FullPath, startFileName string, inclusive bool, limit int) (entries []*filer2.Entry, err error) {
|
||||
|
||||
@@ -134,7 +134,7 @@ func TestCreateFileAndList(t *testing.T) {
|
||||
}
|
||||
|
||||
// delete file and count
|
||||
filer.DeleteEntry(file3Path)
|
||||
filer.DeleteEntryMetaAndData(file3Path)
|
||||
entries, _ = filer.ListDirectoryEntries(filer2.FullPath("/home/chris/this/is"), "", false, 100)
|
||||
if len(entries) != 1 {
|
||||
t.Errorf("list entries count: %v", len(entries))
|
||||
|
||||
Reference in New Issue
Block a user