// Check initialization parameters
File dataDir = getDataDir();
if (dataDir == null) {
throw new SailException("Data dir has not been set");
}
else if (!dataDir.exists()) {
boolean success = dataDir.mkdirs();
if (!success) {
throw new SailException("Unable to create data directory: " + dataDir);
}
}
else if (!dataDir.isDirectory()) {
throw new SailException("The specified path does not denote a directory: " + dataDir);
}
else if (!dataDir.canRead()) {
throw new SailException("Not allowed to read from the specified directory: " + dataDir);
}
logger.debug("Data dir is " + dataDir);
try {
namespaceStore = new NamespaceStore(dataDir);
valueStore = new ValueStore(dataDir, forceSync);
tripleStore = new TripleStore(dataDir, tripleIndexes, forceSync);
}
catch (IOException e) {
throw new SailException(e);
}
initialized = true;
logger.debug("NativeStore initialized");
}