if (readOnly) {
newFile = new RandomAccessFile(file, "r");
} else {
if (!file.canWrite()) {
// //logger.severe("Unable to write:" + file.getPath());
throw new ReadOnlyFileException(ErrorMessage.NO_PERMISSIONS_TO_WRITE_TO_FILE.getMsg(file.getPath()));
}
newFile = new RandomAccessFile(file, "rws");
}
return newFile;
}