Show / Hide Table of Contents

Interface IFileEnvironment

Represents the environment that a device can interact with files.

Inherited Members
IDeviceEnvironment.Name
IDeviceContainer.Device
IHasConnectionStatus.ConnectionStatus
Namespace: Microsoft.XboxStudios.DeviceConsole.Environments.File
Assembly: DeviceConsole.Environments.dll
Syntax
public interface IFileEnvironment : IDeviceEnvironment, IDeviceContainer, IHasConnectionStatus

Methods

View Source

DeleteFileAsync(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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

View Source

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.

Extension Methods

IHasConnectionStatusExtensions.IsConnected(IHasConnectionStatus)
  • View Source
In This Article
Back to top Generated by DocFX