Interface IFileEnvironment
Represents the environment that a device can interact with files.
Inherited Members
Namespace: Microsoft.XboxStudios.DeviceConsole.Environments.File
Assembly: DeviceConsole.Environments.dll
Syntax
public interface IFileEnvironment : IDeviceEnvironment, IDeviceContainer, IHasConnectionStatus
Methods
View SourceDeleteFileAsync(string, TimeSpan?)
Deletes a file from the device.
Declaration
Task DeleteFileAsync(string path, TimeSpan? timeout = null)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path of the file to delete. |
TimeSpan? | timeout | The timeout for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |
DeleteFileAsync(string, CancellationToken)
Deletes a file from the device.
Declaration
Task DeleteFileAsync(string path, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path of the file to delete. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |
GetFileAsync(string, TimeSpan?)
Gets a stream for a file from the device.
Declaration
Task<Stream> GetFileAsync(string path, TimeSpan? timeout = null)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the file on the device. |
TimeSpan? | timeout | The timeout for the operation. |
Returns
Type | Description |
---|---|
Task<Stream> | A stream of the file. |
GetFileAsync(string, CancellationToken)
Gets a stream for a file from the device.
Declaration
Task<Stream> GetFileAsync(string path, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the file on the device. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task<Stream> | A stream of the file. |
GetFolderContentsAsync(string, TimeSpan?)
Gets the contents of a folder on the device.
Declaration
Task<IEnumerable<FileMetadata>> GetFolderContentsAsync(string path, TimeSpan? timeout = null)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the folder. |
TimeSpan? | timeout | The timeout for the operation. |
Returns
Type | Description |
---|---|
Task<IEnumerable<FileMetadata>> | The metadata of all the contents. |
GetFolderContentsAsync(string, CancellationToken)
Gets the contents of a folder on the device.
Declaration
Task<IEnumerable<FileMetadata>> GetFolderContentsAsync(string path, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to the folder. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task<IEnumerable<FileMetadata>> | The metadata of all the contents. |
GetRootPathsAsync(TimeSpan?)
Gets the root paths on the device.
Declaration
Task<IEnumerable<string>> GetRootPathsAsync(TimeSpan? timeout = null)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan? | timeout | The timeout for the operation. |
Returns
Type | Description |
---|---|
Task<IEnumerable<string>> | An enumerable of the root paths that can be browsed on the device. |
GetRootPathsAsync(CancellationToken)
Gets the root paths on the device.
Declaration
Task<IEnumerable<string>> GetRootPathsAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task<IEnumerable<string>> | An enumerable of the root paths that can be browsed on the device. |
RenameFileAsync(string, string, TimeSpan?)
Renames a file on the device.
Declaration
Task RenameFileAsync(string path, string newFilename, TimeSpan? timeout = null)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path of the file to rename. |
string | newFilename | The new filename for the file. |
TimeSpan? | timeout | The timeout for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |
RenameFileAsync(string, string, CancellationToken)
Renames a file on the device.
Declaration
Task RenameFileAsync(string path, string newFilename, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path of the file to rename. |
string | newFilename | The new filename for the file. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |
UploadFileAsync(string, string, TimeSpan?)
Uploads a file to the device.
Declaration
Task UploadFileAsync(string filePath, string destinationFolderPath, TimeSpan? timeout = null)
Parameters
Type | Name | Description |
---|---|---|
string | filePath | The location of the file to upload. |
string | destinationFolderPath | The path of the folder on the device to upload to. |
TimeSpan? | timeout | The timeout for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |
UploadFileAsync(string, string, CancellationToken)
Uploads a file to the device.
Declaration
Task UploadFileAsync(string filePath, string destinationFolderPath, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | filePath | The location of the file to upload. |
string | destinationFolderPath | The path of the folder on the device to upload to. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |