carddav: add AddressObject.Remove

This commit is contained in:
emersion
2017-09-14 11:51:57 +02:00
parent 579a25f989
commit f8d9f83cbc
2 changed files with 12 additions and 1 deletions

View File

@@ -370,7 +370,17 @@ func (fs *fileSystem) OpenFile(ctx context.Context, name string, flag int, perm
}
func (fs *fileSystem) RemoveAll(ctx context.Context, name string) error {
return errNotYetImplemented
if name == "/" {
return errUnsupported
}
id := fs.addressObjectID(name)
ao, err := fs.ab.GetAddressObject(id)
if err != nil {
return err
}
return ao.Remove()
}
func (fs *fileSystem) Rename(ctx context.Context, oldName, newName string) error {