Ejemplo n.º 1
0
 /// <summary>
 /// Copies a given file to a new destination.
 /// </summary>
 /// <param name="virtualFilePath">A qualified name (corresponding to
 /// <see cref="VirtualResourceInfo.FullName"/> that identifies the resource
 /// in the file system.</param>
 /// <param name="destinationPath">The new path of the resource. Can be another name
 /// for the resource itself.</param>
 /// <returns>A <see cref="VirtualFileInfo"/> object that represents the new
 /// file in the file system.</returns>
 /// <exception cref="ArgumentNullException">If any of the parameters is a
 /// null reference.</exception>
 /// <exception cref="ResourceAccessException">In case of invalid or prohibited
 /// resource access, or if the operation is not possible (e.g. a resource being
 /// moved/copied to itself).</exception>
 /// <exception cref="VirtualResourceNotFoundException">If the resource that
 /// should be moved does not exist in the file system.</exception>
 /// <exception cref="ResourceOverwriteException">If a resource that matches the
 /// submitted <paramref name="destinationPath"/> already exists.</exception>
 public override VirtualFileInfo CopyFile(string virtualFilePath, string destinationPath)
 {
     return(SecureFunc(FileSystemTask.FileCopyRequest,
                       () => OperationService.CopyFile(virtualFilePath, destinationPath),
                       () =>
                       String.Format("Could not copy file [{0}] to destination [{1}].", virtualFilePath,
                                     destinationPath)));
 }