if (DATABASES.containsKey(canonicalName)) {
// Fetch the existing data store.
this.dbData = (DataStore)DATABASES.get(canonicalName);
} else {
// Create a new data store.
this.dbData = new DataStore(canonicalName);
DATABASES.put(canonicalName, dbData);
}
}
// Specify the data directory and the temp directory.
dataDirectory = new VirtualFile(canonicalName, dbData);
tempDir = new VirtualFile(normalizePath(canonicalName, "tmp"),
dbData);
// Handle cases where the database name is null, but a system home
// directory has been specified.
} else if (home != null) {
// Return the "system home directory" and create a temporary
// directory for it.
final String absHome = new File(home).getCanonicalPath();
synchronized (DATABASES) {
dbData = (DataStore)DATABASES.get(absHome);
if (dbData == null) {
// Create a new data store for the specified home.
dbData = new DataStore(absHome);
DATABASES.put(absHome, dbData);
}
}
dataDirectory = new VirtualFile(absHome, dbData);
tempDir = new VirtualFile(getSeparator() + "tmp", dbData);