use of de.ipbhalle.exception.CouldNotReadStatusException in project MetFragRelaunched by ipb-halle.
the class MetFragRestController method readStatus.
/**
* @param processid
* @return
* @throws CouldNotReadStatusException
*/
private StatusAssembler readStatus(String processid) throws CouldNotReadStatusException {
File statusfile = new File(this.getResultFolderName(processid) + Constants.OS_SPECIFIC_FILE_SEPARATOR + STATUS_FILE_NAME);
if (statusfile.canRead()) {
String status = "";
try {
BufferedReader breader = new BufferedReader(new FileReader(statusfile));
status = breader.readLine();
breader.close();
return new StatusAssembler("status", status);
} catch (IOException e) {
e.printStackTrace();
throw new CouldNotReadStatusException(processid);
}
}
throw new CouldNotReadStatusException(processid);
}
Aggregations