|
|
@ -132,6 +132,12 @@ func (f *Filer) CreateEntry(entry *Entry) error { |
|
|
|
return fmt.Errorf("insert entry %s: %v", entry.FullPath, err) |
|
|
|
} |
|
|
|
} else { |
|
|
|
if oldEntry.IsDirectory() && !entry.IsDirectory() { |
|
|
|
return fmt.Errorf("existing %s is a directory", entry.FullPath) |
|
|
|
} |
|
|
|
if !oldEntry.IsDirectory() && entry.IsDirectory() { |
|
|
|
return fmt.Errorf("existing %s is a file", entry.FullPath) |
|
|
|
} |
|
|
|
if err := f.store.UpdateEntry(entry); err != nil { |
|
|
|
return fmt.Errorf("update entry %s: %v", entry.FullPath, err) |
|
|
|
} |
|
|
|