use of org.apache.jena.tdb2.TDBException in project jena by apache.
the class SpotTDB2 method checkStorageArea.
/**
* Check all files exist for a TDB2 database, or the area is empty (and so a new
* database can be created in the location). Throw {@link TDBException} is a file
* is missing.
*/
private static void checkStorageArea(Location location) {
if (location.isMem())
return;
if (isEmpty(location))
return;
// Journal, fixed name.
validate(location, Names.journalFileBase, Names.extJournal);
// Places for StoreParams: location or default
StoreParams params = getStoreParams(location);
// Check for indexes
containsIndex(params.getPrimaryIndexTriples(), params.getTripleIndexes());
validateBPT(location, params.getTripleIndexes());
containsIndex(params.getPrimaryIndexQuads(), params.getTripleIndexes());
validateBPT(location, params.getQuadIndexes());
// prefixes. GPU
containsIndex(params.getPrimaryIndexPrefix(), params.getPrefixIndexes());
// GPU is not in files "GPU"
// Filename of GPU.
validateBPT(location, params.getPrefixIndexes());
// ---- Node tables.
/*
* nodes.bpt
* nodes.dat
* nodes-data.bdf
* nodes-data.obj
*/
validateBPT(location, params.getNodeTableBaseName());
validateDAT(location, params.getNodeTableBaseName() + "-data");
/*
* prefixes...
*/
// XXX validateBPT(location, params.getPrefixTableBaseName());
validateBPT(location, params.getPrefixTableBaseName());
validateDAT(location, params.getPrefixTableBaseName() + "-data");
}
Aggregations