A ResourceType based file interface.
More...
A ResourceType based file interface.
◆ AutoRenameAsync()
Task<IFile> AutoRenameAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Asynchronously does automatic file rename, such that no file with the same name exists in the ResourceType.
- Parameters
-
cancellationToken | A cancellation token. |
- Returns
- A renamed file.
◆ CopyAsync()
Task CopyAsync |
( |
IFile |
destinationFile, |
|
|
bool |
allowOverwrite, |
|
|
CancellationToken |
cancellationToken |
|
) |
| |
Asynchronously copies file.
- Parameters
-
destinationFile | A destination file. |
allowOverwrite | When true will try to overwrite existing files. |
cancellationToken | A cancellation token. |
◆ DeleteAsync()
Task DeleteAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Asynchronoulsy deletes file.
- Parameters
-
cancellationToken | A cancellation token |
◆ ExistsAsync()
Task<bool> ExistsAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Asynchronously checks if file exists.
- Parameters
-
cancellationToken | A cancellation token. |
- Returns
- True if file exists, false otherwise.
◆ GetFileInfoAsync()
Task<FileInfo> GetFileInfoAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Asynchronously gets file information.
- Parameters
-
cancellationToken | A cancellation token. |
- Returns
- A FileInfo structure.
◆ GetHashAsync()
Task<string> GetHashAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Asynchronously calculates file hash.
- Parameters
-
cancellationToken | A cancellation token. |
- Returns
- A file hash.
◆ GetUrlAsync()
Task<string> GetUrlAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Asynchronously gets file url.
If a file system should generate Proxy
commands, a file url should be retreived with help of IProxyUrlGenerator.
- Parameters
-
cancellationToken | A cancellation token. |
- Returns
- A file url.
◆ HasValidExtension() [1/2]
bool HasValidExtension |
( |
| ) |
|
Checks if the extension is valid on the ResourceType.
- Returns
- True if extension is valid, false otherwise.
◆ HasValidExtension() [2/2]
bool HasValidExtension |
( |
bool |
checkDoubleExtension | ) |
|
Checks if the extension is valid on the ResourceType.
- Parameters
-
checkDoubleExtension | If true the method will split file name by dot character and check each part beside the first one against valid extensions list. |
- Returns
- True if extension is valid, false otherwise.
◆ IsHidden()
Checks if file is hidden on the ResourceType.
- Returns
- True if file is hidden, false otherwise.
◆ MoveAsync()
Task MoveAsync |
( |
IFile |
destinationFile, |
|
|
bool |
allowOverwrite, |
|
|
CancellationToken |
cancellationToken |
|
) |
| |
Asynchronously moves file.
May be used for rename operation.
- Parameters
-
destinationFile | A destination file. |
allowOverwrite | When true will try to overwrite existing files. |
cancellationToken | A cancellation token. |
◆ ReadAsync()
Task<Stream> ReadAsync |
( |
CancellationToken |
cancellationToken | ) |
|
Asynchronously reads file content.
- Parameters
-
cancellationToken | A cancellation token. |
- Returns
- A stream with file content.
◆ WriteAsync()
Task WriteAsync |
( |
Stream |
stream, |
|
|
CancellationToken |
cancellationToken |
|
) |
| |
Asynchronously writes file content.
- Parameters
-
stream | A stream with file content. |
cancellationToken | A cancellation token. |
◆ Extension
◆ FullPath
Gets the absolute path to the file.
◆ Name
◆ NameWithoutExtension
string NameWithoutExtension |
|
get |
Gets the file name without the extension.
◆ ParentFolder
Gets parent folder instance.
◆ Path
◆ ResourceType
ResourceType ResourceType |
|
get |
The documentation for this interface was generated from the following file: