Exemplo n.º 1
0
 public virtual async Task MoveFolderAsync([Required, StringLength(255)] string path, FolderMoveDto input)
 {
     await FileSystemAppService.MoveFolderAsync(path, input);
 }
Exemplo n.º 2
0
        public virtual Task MoveFolderAsync([Required, StringLength(255)] string path, FolderMoveDto input)
        {
            string fileSystemPath = GetFileSystemPath(path);

            if (!Directory.Exists(fileSystemPath))
            {
                throw new UserFriendlyException(L["FilePathNotFound"]);
            }
            var moveToFilePath = GetFileSystemPath(input.MoveToPath);

            if (Directory.Exists(moveToFilePath))
            {
                throw new UserFriendlyException(L["FilePathAlreadyExists"]);
            }

            Directory.Move(fileSystemPath, moveToFilePath);

            return(Task.CompletedTask);
        }