Commit 27a725fe authored by akucera's avatar akucera
Browse files

refactoring to keep consistency with the DAAPI approach

parent 65e881f6
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -43,9 +43,7 @@ public class Application extends ResourceConfig {
		registerInstances(new AuthenticationFilter("semantics", prop));
		// TODO: data-level auth (semantic API)
		
		
		//TODO: pass properties to the TDB (consistency with data acess API)
        TdbConnector.setPaths((prop.getProperty("tdb.path") != null) ? prop.getProperty("tdb.path") : "./sbmstdb");
		TdbConnector.init(prop);
        //ModelUpdater.cleanup();
        TdbConnector.open();
	}
+3 −3
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;

import org.apache.jena.ontology.OntModelSpec;
@@ -35,9 +36,8 @@ public class TdbConnector {
	
	final static Logger logger = Logger.getLogger(TdbConnector.class);
	
	public static void setPaths(String path) {
		
		TdbConnector.dataPath = path;
	public static void init(Properties props) {
		TdbConnector.dataPath = (props != null && props.getProperty("tdb.path") != null) ? props.getProperty("tdb.path") : "./sbmstdb";
		dataset = TDBFactory.createDataset(dataPath) ;
	}