if (!f.exists()) {
LOGGER.finer("Creating File: " + f.toString());
if (isDir) {
if (!f.mkdir()) {
throw new ConfigurationException(
"Path specified does not have a valid file.\n" + f
+ "\n\n");
}
} else {
try {
LOGGER.severe("Attempting to create file:" + f.getAbsolutePath());
if (!f.createNewFile()) {
throw new ConfigurationException(
"Path specified does not have a valid file.\n" + f
+ "\n\n");
}
} catch (IOException e) {
throw new ConfigurationException(e);
}
}
}
if (isDir && !f.isDirectory()) {
throw new ConfigurationException(
"Path specified does not have a valid file.\n" + f + "\n\n");
}
if (!isDir && !f.isFile()) {
throw new ConfigurationException(
"Path specified does not have a valid file.\n" + f + "\n\n");
}
LOGGER.finer("File is valid: " + f);