if (log.isDebugEnabled()) {
log.debug(location.getPath() + " is empty");
}
} else {
log.error(location.getPath() + " is not an empty directory");
throw new ConfigurationAlreadyExistsException("Configuration already exists: " + configId);
}
} else {
if (log.isDebugEnabled()) {
log.debug("Creating configuration directory: " + location.getPath());
}
location.mkdirs();
}
if (!location.exists()) {
throw new ConfigurationAlreadyExistsException("Could not create configuration directory: " + location);
}
return location;
}