use of de.ipbhalle.exception.CouldNotRemoveProcessException in project MetFragRelaunched by ipb-halle.
the class MetFragRestController method removeProcess.
/*
* some helper methods
*/
/**
* @param processid
* @throws CouldNotRemoveProcessException
*/
private void removeProcess(String processid) throws CouldNotRemoveProcessException {
File file = new File(this.getResultFolderName(processid));
if (!file.exists())
throw new CouldNotRemoveProcessException("Process with id " + processid + " not found");
if (!file.canWrite())
throw new CouldNotRemoveProcessException("Process with id " + processid + " cannot be deleted");
try {
FileUtils.deleteDirectory(file);
} catch (Exception e) {
throw new CouldNotRemoveProcessException(e.getMessage());
}
System.out.println("Deleted " + file.getAbsolutePath());
}
Aggregations