*
* @throws InvalidHostFileException
*/
public void saveHostFile() throws InvalidHostFileException {
if (!hostFileWriteable) {
throw new InvalidHostFileException("Host file is not writeable.");
}
log.info("Saving " + defaultHostFile);
try {
File f = new File(hostFile);
FileOutputStream out = new FileOutputStream(f);
out.write(toString().getBytes());
out.close();
} catch (IOException e) {
throw new InvalidHostFileException("Could not write to " +
hostFile);
}
}