| | |
| | | if (target.exists()) { |
| | | if (!target.delete()) { |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.FILE_SYSTEM_ERROR, |
| | | ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, |
| | | getMsg("error-deleting-file", |
| | | Utils.getPath(target)), null); |
| | | } |
| | |
| | | } |
| | | if (!fileToRename.renameTo(target)) { |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.FILE_SYSTEM_ERROR, |
| | | ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, |
| | | getMsg("error-renaming-file", |
| | | Utils.getPath(fileToRename), |
| | | Utils.getPath(target)), null); |
| | |
| | | } catch (Exception e) { |
| | | String errMsg = getMsg("error-copying-file", args); |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.FILE_SYSTEM_ERROR, |
| | | ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, |
| | | errMsg, null); |
| | | } finally { |
| | | if (fis != null) { |
| | |
| | | } else { |
| | | String errMsg = getMsg("error-copying-file", args); |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.FILE_SYSTEM_ERROR, errMsg, null); |
| | | ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, |
| | | errMsg, null); |
| | | } |
| | | } else { |
| | | LOG.log(Level.INFO, "Ignoring file '" + |
| | |
| | | errMsg = getMsg("error-deleting-directory", arg); |
| | | } |
| | | throw new ApplicationException( |
| | | ApplicationException.Type.FILE_SYSTEM_ERROR, errMsg, null); |
| | | ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, |
| | | errMsg, null); |
| | | } |
| | | |
| | | if (application != null) { |