StoreClassNotFoundException {
this.exportPersistedClassByteCode = exportPersistedClassByteCode;
final File directory = new File(directoryName);
if (directory.exists()) {
if (!directory.isDirectory()) {
throw new StoreException(directory
+ " exists and is not a directory");
}
} else if (!directory.mkdirs()) {
throw new StoreException("failed create directory " + directory);
}
if (exportPersistedClassByteCode) {
classDirectory = new File(directory, "class");
if (classDirectory.exists()) {
if (classDirectory.isDirectory()) {
final File[] files = classDirectory.listFiles();
for (final File file : files) {
if (file.getName().endsWith(".class") && !file.delete()) {// NOPMD
throw new StoreException("failed delete " + file);
}
}
} else if (!classDirectory.delete()) {
throw new StoreException("failed delete " + classDirectory);
}
} else if (!classDirectory.mkdirs()) {
throw new StoreException("failed create directory "
+ classDirectory);
}
classSet = new HashSet<Class<?>>();
}
final File temporaryDirectory = new File(temporaryDirectoryName);
if (temporaryDirectory.exists()) {
if (!temporaryDirectory.isDirectory()) {
throw new StoreException(temporaryDirectory
+ " exists and is not a directory");
}
} else if (!temporaryDirectory.mkdirs()) {
throw new StoreException("failed create directory "
+ temporaryDirectory);
}
try {
exportStoreQue = new PersistantDataRecordIdentifierSetQue(temporaryDirectoryName);
} catch (HeapException exception) {
throw new StoreException(exception);
}
open(directory);
}