예제 #1
0
 /// <summary>
 ///     Moves the file to the specified location.
 /// </summary>
 /// <param name="destinationPath">
 ///     The location to which the file should be moved.
 /// </param>
 /// <param name="options">
 ///     Defines how to react if another file with a conflicting name already exists at the destination.
 /// </param>
 /// <param name="cancellationToken">
 ///     A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
 /// </param>
 /// <returns>
 ///     A <see cref="StorageFile"/> instance representing the new location of the moved file.
 /// </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="destinationPath"/> is <see langword="null"/>.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     <paramref name="destinationPath"/> is a <see cref="StoragePath"/> instance which is incompatible
 ///     with this <see cref="FileSystem"/> implementation.
 ///     This exception generally occurs when you are using multiple <see cref="FileSystem"/>
 ///     implementations simultaneously.
 ///
 ///     This exception is <b>always</b> thrown when the type of <paramref name="destinationPath"/>
 ///     doesn't match the specific <see cref="StoragePath"/> type created by the current
 ///     <see cref="FileSystem"/> implementation.
 ///     This condition <b>may</b>, however, be enhanced by any <see cref="FileSystem"/>
 ///     implementation.
 /// </exception>
 /// <exception cref="OperationCanceledException">
 ///     The operation was cancelled via the specified <paramref name="cancellationToken"/>.
 /// </exception>
 /// <exception cref="UnauthorizedAccessException">
 ///     Access to the file or the destination folder is restricted.
 /// </exception>
 /// <exception cref="PathTooLongException">
 ///     The length of the file's path exceeds the system-defined maximum length.
 /// </exception>
 /// <exception cref="IOException">
 ///     Another file already exists at the destination and <paramref name="options"/> has
 ///     the value <see cref="CreationCollisionOption.Fail"/>.
 ///
 ///     -or-
 ///
 ///     A conflicting folder exists at the destination.
 ///
 ///     -or-
 ///
 ///     An I/O error occured while interacting with the file system.
 /// </exception>
 /// <exception cref="DirectoryNotFoundException">
 ///     One of the file's parent folders does not exist.
 ///
 ///     -or-
 ///
 ///     The destination folder does not exist.
 /// </exception>
 /// <exception cref="FileNotFoundException">
 ///     The file does not exist.
 /// </exception>
 public abstract Task <StorageFile> MoveAsync(
     StoragePath destinationPath,
     NameCollisionOption options,
     CancellationToken cancellationToken = default
     );
예제 #2
0
 /// <summary>
 ///     Moves the file to the specified location.
 ///     An exception is thrown if a file already exists at the destination.
 /// </summary>
 /// <param name="destinationPath">
 ///     The location to which the file should be moved.
 /// </param>
 /// <param name="cancellationToken">
 ///     A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
 /// </param>
 /// <returns>
 ///     A <see cref="StorageFile"/> instance representing the new location of the moved file.
 /// </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="destinationPath"/> is <see langword="null"/>.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     <paramref name="destinationPath"/> is a <see cref="StoragePath"/> instance which is incompatible
 ///     with this <see cref="FileSystem"/> implementation.
 ///     This exception generally occurs when you are using multiple <see cref="FileSystem"/>
 ///     implementations simultaneously.
 ///
 ///     This exception is <b>always</b> thrown when the type of <paramref name="destinationPath"/>
 ///     doesn't match the specific <see cref="StoragePath"/> type created by the current
 ///     <see cref="FileSystem"/> implementation.
 ///     This condition <b>may</b>, however, be enhanced by any <see cref="FileSystem"/>
 ///     implementation.
 /// </exception>
 /// <exception cref="OperationCanceledException">
 ///     The operation was cancelled via the specified <paramref name="cancellationToken"/>.
 /// </exception>
 /// <exception cref="UnauthorizedAccessException">
 ///     Access to the file or the destination folder is restricted.
 /// </exception>
 /// <exception cref="PathTooLongException">
 ///     The length of the file's path exceeds the system-defined maximum length.
 /// </exception>
 /// <exception cref="IOException">
 ///     Another file already exists at the destination.
 ///
 ///     -or-
 ///
 ///     A conflicting folder exists at the destination.
 ///
 ///     -or-
 ///
 ///     An I/O error occured while interacting with the file system.
 /// </exception>
 /// <exception cref="DirectoryNotFoundException">
 ///     One of the file's parent folders does not exist.
 ///
 ///     -or-
 ///
 ///     The destination folder does not exist.
 /// </exception>
 /// <exception cref="FileNotFoundException">
 ///     The file does not exist.
 /// </exception>
 public Task <StorageFile> MoveAsync(StoragePath destinationPath, CancellationToken cancellationToken = default) =>
 MoveAsync(destinationPath, DefaultNameCollisionOption, cancellationToken);
예제 #3
0
 /// <inheritdoc cref="Combine(string)"/>
 public StoragePath Combine(StoragePath other) =>
 Combine(other?.UnderlyingString !);
예제 #4
0
 /// <summary>
 ///     Copies the folder and all of its contents to the specified location.
 ///     An exception is thrown if a folder already exists at the destination.
 /// </summary>
 /// <param name="destinationPath">
 ///     The location to which the folder should be copied.
 /// </param>
 /// <param name="cancellationToken">
 ///     A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
 /// </param>
 /// <returns>
 ///     A <see cref="StorageFolder"/> instance representing the newly created copy of this folder.
 /// </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="destinationPath"/> is <see langword="null"/>.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     <paramref name="destinationPath"/> is a <see cref="StoragePath"/> instance which is incompatible
 ///     with this <see cref="FileSystem"/> implementation.
 ///     This exception generally occurs when you are using multiple <see cref="FileSystem"/>
 ///     implementations simultaneously.
 ///
 ///     This exception is <b>always</b> thrown when the type of <paramref name="destinationPath"/>
 ///     doesn't match the specific <see cref="StoragePath"/> type created by the current
 ///     <see cref="FileSystem"/> implementation.
 ///     This condition <b>may</b>, however, be enhanced by any <see cref="FileSystem"/>
 ///     implementation.
 /// </exception>
 /// <exception cref="OperationCanceledException">
 ///     The operation was cancelled via the specified <paramref name="cancellationToken"/>.
 /// </exception>
 /// <exception cref="UnauthorizedAccessException">
 ///     Access to the folder or the destination folder is restricted.
 /// </exception>
 /// <exception cref="PathTooLongException">
 ///     The length of the folder's path exceeds the system-defined maximum length.
 /// </exception>
 /// <exception cref="IOException">
 ///     Another folder already exists at the destination.
 ///
 ///     -or-
 ///
 ///     A conflicting file exists at the destination.
 ///
 ///     -or-
 ///
 ///     An I/O error occured while interacting with the file system.
 /// </exception>
 /// <exception cref="DirectoryNotFoundException">
 ///     The folder does not exist.
 ///
 ///     -or-
 ///
 ///     One of the folder's parent folders does not exist.
 ///
 ///     -or-
 ///
 ///     The destination folder does not exist.
 /// </exception>
 public Task <StorageFolder> CopyAsync(StoragePath destinationPath, CancellationToken cancellationToken = default) =>
 CopyAsync(destinationPath, DefaultNameCollisionOption, cancellationToken);
예제 #5
0
 /// <summary>
 ///     Creates and returns a <see cref="StorageFolder"/> instance which represents a folder
 ///     located by the specified <paramref name="path"/>.
 /// </summary>
 /// <param name="path">
 ///     The string representing the path which locates a folder.
 /// </param>
 /// <returns>
 ///     A new <see cref="StorageFolder"/> instance which represents a folder at the specified
 ///     <paramref name="path"/>.
 /// </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="path"/> is <see langword="null"/>.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     <paramref name="path"/> is a <see cref="StoragePath"/> instance which is incompatible
 ///     with this <see cref="FileSystem"/> implementation.
 ///     This exception generally occurs when you are using multiple <see cref="FileSystem"/>
 ///     implementations simultaneously.
 ///
 ///     This exception is <b>always</b> thrown when the type of <paramref name="path"/>
 ///     doesn't match the specific <see cref="StoragePath"/> type created by the current
 ///     <see cref="FileSystem"/> implementation.
 ///     This condition <b>may</b>, however, be enhanced by any <see cref="FileSystem"/>
 ///     implementation.
 /// </exception>
 /// <seealso cref="TryGetFolder(StoragePath?, out StorageFolder?)"/>
 public abstract StorageFolder GetFolder(StoragePath path);
예제 #6
0
 /// <summary>
 ///     Returns a <see cref="StorageFile"/> instance which represents the file at the specified
 ///     <paramref name="path"/>.
 /// </summary>
 /// <param name="path">The path which locates a file.</param>
 /// <returns>
 ///     A new <see cref="StorageFile"/> instance which represents a file at the specified
 ///     <paramref name="path"/>.
 /// </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="path"/> is <see langword="null"/>.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     <paramref name="path"/> is a <see cref="StoragePath"/> instance which is incompatible
 ///     with this <see cref="FileSystem"/> implementation.
 ///     This exception generally occurs when you are using multiple <see cref="FileSystem"/>
 ///     implementations simultaneously.
 ///
 ///     This exception is <b>always</b> thrown when the type of <paramref name="path"/>
 ///     doesn't match the specific <see cref="StoragePath"/> type created by the current
 ///     <see cref="FileSystem"/> implementation.
 ///     This condition <b>may</b>, however, be enhanced by any <see cref="FileSystem"/>
 ///     implementation.
 /// </exception>
 /// <seealso cref="TryGetFile(StoragePath?, out StorageFile?)"/>
 public abstract StorageFile GetFile(StoragePath path);