use of de.ipbhalle.exception.CouldNotReadHostException in project MetFragRelaunched by ipb-halle.
the class MetFragRestController method readHost.
/**
* @param processid
* @return
* @throws CouldNotReadHostException
*/
protected HostAssembler readHost(String processid) throws CouldNotReadHostException {
File hostfile = new File(this.getResultFolderName(processid) + Constants.OS_SPECIFIC_FILE_SEPARATOR + HOST_FILE_NAME);
if (hostfile.canRead()) {
String host = "";
try {
BufferedReader breader = new BufferedReader(new FileReader(hostfile));
host = breader.readLine();
breader.close();
return new HostAssembler("host", host);
} catch (IOException e) {
e.printStackTrace();
throw new CouldNotReadHostException(processid);
}
}
throw new CouldNotReadHostException(processid);
}
Aggregations