Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,16 @@ private void EnsurePathExists(string path)
Directory.CreateDirectory(directoryPath);
}
}

public Task DeleteExtendedPropertiesAsync(string storeAbsolutePath, IPrivateFileReference file)
{
var extendedPropertiesPath = this.GetExtendedPropertiesPath(storeAbsolutePath, file);
if (File.Exists(extendedPropertiesPath))
{
File.Delete(extendedPropertiesPath);
}

return Task.FromResult(0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ public interface IExtendedPropertiesProvider
ValueTask<Internal.FileExtendedProperties> GetExtendedPropertiesAsync(string storeAbsolutePath, IPrivateFileReference file);

Task SaveExtendedPropertiesAsync(string storeAbsolutePath, IPrivateFileReference file, Internal.FileExtendedProperties extendedProperties);

Task DeleteExtendedPropertiesAsync(string storeAbsolutePath, IPrivateFileReference file);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ public FileSystemFileReference(

public IFileProperties Properties => this.propertiesLazy.Value;

public Task DeleteAsync()
public async Task DeleteAsync()
{
File.Delete(this.FileSystemPath);
return Task.FromResult(true);

if (extendedPropertiesProvider != null)
{
await extendedPropertiesProvider.DeleteExtendedPropertiesAsync(this.FileSystemPath, this);
}
}

public ValueTask<byte[]> ReadAllBytesAsync()
Expand Down