public bool Rename(string filePath, string newName) { var parentDirectory = _pathService.GetParentDirectory(filePath); var newFilePath = _pathService.Combine(parentDirectory, newName); try { _environmentFileService.Move(filePath, newFilePath); } catch { return(false); } return(true); }
public bool Rename(string filePath, string newName) { var parentDirectory = _pathService.GetParentDirectory(filePath); var newFilePath = _pathService.Combine(parentDirectory, newName); try { _environmentFileService.Move(filePath, newFilePath); } catch (Exception ex) { _logger.LogError($"Failed to rename file {filePath} to {newName} with error {ex}"); return(false); } return(true); }
public void Move(string oldFilePath, string newFilePath) => _environmentFileService.Move(oldFilePath, newFilePath);