if (!dir.mkdirs()) // Find out what went wrong...
setupRepositoryDirectory(dir.getParentFile());
}
if (!dir.canRead())
throw new RepositoryException("Read permission not set: " + dir.getAbsolutePath());
if (!dir.canWrite())
throw new RepositoryException("Write permission not set: " + dir.getAbsolutePath());
// Workaround for the canExecute method which does not exist in Java 5
try {
File tempFile = new File(dir.getAbsoluteFile() + File.separator + "delete_me.tmp");
tempFile.createNewFile();
tempFile.delete();
} catch (IOException e) {
throw new RepositoryException("Execute permission not set: " + dir.getAbsolutePath(), e);
}
}