Class PathSelectionResult
The result of a SelectAsync(IUnixFileSystem, Nullable<String>, CancellationToken) operation.
Inherited Members
Namespace: FubarDev.FtpServer.FileSystem
Assembly: FubarDev.FtpServer.Abstractions.dll
Syntax
public class PathSelectionResult
Properties
| Improve this Doc View SourceDirectory
Gets the directory of the search result.
Declaration
public IUnixDirectoryEntry Directory { get; }
Property Value
| Type | Description |
|---|---|
| IUnixDirectoryEntry |
Remarks
When ResultType is FoundDirectory, this is the found directory. When ResultType is FoundFile, this is the parent directory. Otherwise, this is the last found directory.
File
Gets the found document.
Declaration
public IUnixFileEntry? File { get; }
Property Value
| Type | Description |
|---|---|
| Nullable<IUnixFileEntry> |
Remarks
This property is only valid when ResultType is FoundFile.
FullPath
Gets the full root-relative path of the element that was searched.
Declaration
public string FullPath { get; }
Property Value
| Type | Description |
|---|---|
| String |
IsMissing
Gets a value indicating whether there was a missing path part.
Declaration
public bool IsMissing { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
MissingNames
Gets the directory of missing child elements.
Declaration
public IReadOnlyCollection<string> MissingNames { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<String> |
Remarks
This is only valid, when IsMissing is true.
ResultType
Gets the type of the result.
Declaration
public PathSelectionResultType ResultType { get; }
Property Value
| Type | Description |
|---|---|
| PathSelectionResultType |
TargetEntry
Gets the found target entry.
Declaration
public IUnixFileSystemEntry TargetEntry { get; }
Property Value
| Type | Description |
|---|---|
| IUnixFileSystemEntry |
Remarks
This is only valid when IsMissing is false.
Methods
| Improve this Doc View SourceCreate(Stack<IUnixDirectoryEntry>)
Creates a selection result for a found directory.
Declaration
public static PathSelectionResult Create(Stack<IUnixDirectoryEntry> foundPathSegments)
Parameters
| Type | Name | Description |
|---|---|---|
| Stack<IUnixDirectoryEntry> | foundPathSegments | The found path segments. |
Returns
| Type | Description |
|---|---|
| PathSelectionResult | The created selection result. |
Create(Stack<IUnixDirectoryEntry>, IUnixFileEntry)
Creates a selection result for a found file.
Declaration
public static PathSelectionResult Create(Stack<IUnixDirectoryEntry> foundPathSegments, IUnixFileEntry document)
Parameters
| Type | Name | Description |
|---|---|---|
| Stack<IUnixDirectoryEntry> | foundPathSegments | The found path segments. |
| IUnixFileEntry | document | The found file. |
Returns
| Type | Description |
|---|---|
| PathSelectionResult | The created selection result. |
CreateMissingDirectory(Stack<IUnixDirectoryEntry>, IReadOnlyCollection<String>)
Creates a selection for a missing directory.
Declaration
public static PathSelectionResult CreateMissingDirectory(Stack<IUnixDirectoryEntry> foundPathSegments, IReadOnlyCollection<string> missingPathSegments)
Parameters
| Type | Name | Description |
|---|---|---|
| Stack<IUnixDirectoryEntry> | foundPathSegments | The found path segments. |
| IReadOnlyCollection<String> | missingPathSegments | The missing path elements. |
Returns
| Type | Description |
|---|---|
| PathSelectionResult | The created selection result. |
CreateMissingFileOrDirectory(Stack<IUnixDirectoryEntry>, IReadOnlyCollection<String>)
Creates a selection for a missing file or directory.
Declaration
public static PathSelectionResult CreateMissingFileOrDirectory(Stack<IUnixDirectoryEntry> foundPathSegments, IReadOnlyCollection<string> missingPathSegments)
Parameters
| Type | Name | Description |
|---|---|---|
| Stack<IUnixDirectoryEntry> | foundPathSegments | The found path segments. |
| IReadOnlyCollection<String> | missingPathSegments | The missing path elements. |
Returns
| Type | Description |
|---|---|
| PathSelectionResult | The created selection result. |
GetPath()
Get the full path as directory entries.
Declaration
public Stack<IUnixDirectoryEntry> GetPath()
Returns
| Type | Description |
|---|---|
| Stack<IUnixDirectoryEntry> | The full path as directory entries. |