Class InMemoryDirectory
An in-memory implementation of a WebDAV collection
Inherited Members
Namespace:FubarDev.WebDavServer.FileSystem.InMemory
Assembly:FubarDev.WebDavServer.FileSystem.InMemory.dll
Syntax
public class InMemoryDirectory : InMemoryEntry, IEntityTagEntry, ICollection, IEntry, IRecusiveChildrenCollector
Constructors
| Improve this Doc View SourceInMemoryDirectory(InMemoryFileSystem, ICollection, Uri, String, Boolean)
Initializes a new instance of the InMemoryDirectory class.
Declaration
public InMemoryDirectory([NotNull] InMemoryFileSystem fileSystem, [CanBeNull] ICollection parent, [NotNull] Uri path, [NotNull] string name, bool isRoot = false)
Parameters
Type | Name | Description |
---|---|---|
InMemoryFileSystem | fileSystem | The file system this collection belongs to |
ICollection | parent | The parent collection |
Uri | path | The root-relative path of this collection |
String | name | The name of the collection |
Boolean | isRoot | Is this the file systems root directory? |
Methods
| Improve this Doc View SourceCreateCollection(String)
Creates a new collection
Declaration
public InMemoryDirectory CreateCollection(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the collection to create |
Returns
Type | Description |
---|---|
InMemoryDirectory | The created collection |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | The file system is read-only |
IOException | Document or collection with the same name already exists |
CreateCollectionAsync(String, CancellationToken)
Creates a child collection
Declaration
public Task<ICollection> CreateCollectionAsync(string name, CancellationToken ct)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the new collection |
CancellationToken | ct | The cancellation token |
Returns
Type | Description |
---|---|
Task<ICollection> | The new collection |
Implements
| Improve this Doc View SourceCreateDocument(String)
Creates a document
Declaration
public InMemoryFile CreateDocument(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the document to create |
Returns
Type | Description |
---|---|
InMemoryFile | The created document |
Exceptions
Type | Condition |
---|---|
UnauthorizedAccessException | The file system is read-only |
IOException | Document or collection with the same name already exists |
CreateDocumentAsync(String, CancellationToken)
Creates a document with the given name
Declaration
public Task<IDocument> CreateDocumentAsync(string name, CancellationToken ct)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the new document |
CancellationToken | ct | The cancellation token |
Returns
Type | Description |
---|---|
Task<IDocument> | The created document |
Implements
| Improve this Doc View SourceDeleteAsync(CancellationToken)
Deletes this entry
Declaration
public override Task<DeleteResult> DeleteAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<DeleteResult> | The result of the delete operation |
Overrides
Implements
| Improve this Doc View SourceGetChildAsync(String, CancellationToken)
Gets the child entry with the given name
Declaration
public Task<IEntry> GetChildAsync(string name, CancellationToken ct)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the child entry to get |
CancellationToken | ct | The cancellation token |
Returns
Type | Description |
---|---|
Task<IEntry> | The found entry (or |
Implements
| Improve this Doc View SourceGetChildrenAsync(CancellationToken)
Gets all child entries
Declaration
public Task<IReadOnlyCollection<IEntry>> GetChildrenAsync(CancellationToken ct)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | ct | The cancellation token |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IEntry>> | The found entries |
Implements
| Improve this Doc View SourceGetEntries(Int32)
Gets all child entries up to the depth of maxDepth
Declaration
public IAsyncEnumerable<IEntry> GetEntries(int maxDepth)
Parameters
Type | Name | Description |
---|---|---|
Int32 | maxDepth | The maximum depth (MaxValue as infinity) |
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<IEntry> | All found child entries |