public virtual Task CopyFolderAsync([Required, StringLength(255)] string path, FolderCopyDto input) { string fileSystemPath = GetFileSystemPath(path); if (!Directory.Exists(fileSystemPath)) { throw new UserFriendlyException("指定目录不存在!"); } var copyToFilePath = GetFileSystemPath(input.CopyToPath); if (Directory.Exists(copyToFilePath)) { throw new UserFriendlyException("指定的路径中已经有同名的目录存在!"); } CopyDirectory(fileSystemPath, copyToFilePath); return(Task.CompletedTask); }
public virtual async Task CopyFolderAsync([Required, StringLength(255)] string path, FolderCopyDto input) { await FileSystemAppService.CopyFolderAsync(path, input); }
public virtual Task CopyFolderAsync([Required, StringLength(255)] string path, FolderCopyDto input) { string fileSystemPath = GetFileSystemPath(path); if (!Directory.Exists(fileSystemPath)) { throw new UserFriendlyException(L["PathNotFound"]); } var copyToFilePath = GetFileSystemPath(input.CopyToPath); if (Directory.Exists(copyToFilePath)) { throw new UserFriendlyException(L["FilePathAlreadyExists"]); } CopyDirectory(fileSystemPath, copyToFilePath); return(Task.CompletedTask); }