Skip to content

Package: TDBStorage

TDBStorage

nameinstructionbranchcomplexitylinemethod
TDBStorage(DriverConfiguration)
M: 0 C: 13
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
writeChanges()
M: 7 C: 5
42%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 2 C: 3
60%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: * <p>
4: * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
5: * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
6: * version.
7: * <p>
8: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
9: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
10: * details. You should have received a copy of the GNU General Public License along with this program. If not, see
11: * <http://www.gnu.org/licenses/>.
12: */
13: package cz.cvut.kbss.ontodriver.jena.connector;
14:
15: import cz.cvut.kbss.ontodriver.config.DriverConfiguration;
16: import cz.cvut.kbss.ontodriver.jena.exception.JenaDriverException;
17: import org.apache.jena.tdb.TDB;
18: import org.apache.jena.tdb.TDBFactory;
19:
20: class TDBStorage extends LocalStorage {
21:
22: TDBStorage(DriverConfiguration configuration) {
23: super(configuration);
24: final String location = configuration.getStorageProperties().getPhysicalURI().toString();
25: this.dataset = TDBFactory.createDataset(location);
26: }
27:
28: @Override
29: public void writeChanges() throws JenaDriverException {
30: try {
31: TDB.sync(dataset);
32: } catch (RuntimeException e) {
33: throw new JenaDriverException("Unable to synchronize TDB storage with file system.", e);
34: }
35: }
36: }