src/main/java/org/vivoweb/harvester/util/repo/JenaConnect.java
/**
	 * Build a JenaConnect based on the given parameter set
	 * @param params the value map
	 * @return the JenaConnect
	 * @throws IOException error connecting to jena model
	 */
Build a JenaConnect based on the given parameter set
@param params the value map
@return the JenaConnect
@throws IOException error connecting to jena model
Build a JenaConnect based on the given parameter set @param params the value map @return the JenaConnect @throws IOException error connecting to jena model
private static JenaConnect build(Map<String, String> params) throws IOException {
		if((params == null) || params.isEmpty()) {
			return null;
		}
		if(!params.containsKey("type")) {
			throw new IllegalArgumentException("Must specify 'type' parameter {'rdb','sdb','tdb','file','mem'}");
		}
		String type = params.get("type");
		JenaConnect jc;
		if(type.equalsIgnoreCase("sdb")) {
			jc = new SDBJenaConnect(params.get("dbUrl"), params.get("dbUser"), params.get("dbPass"), params.get("dbType"), params.get("dbClass"), params.get("dbLayout"), params.get("modelName"));
		} else if(type.equalsIgnoreCase("tdb")) {
			jc = new TDBJenaConnect(params.get("dbDir"), params.get("modelName"));
		} else {
			throw new IllegalArgumentException("unknown type: " + type);
		}
		if((params.containsKey("checkEmpty") && (params.get("checkEmpty").toLowerCase() == "true")) && jc.isEmpty()) {
			StringBuilder emptyWarn = new StringBuilder("jena model empty! ");
			emptyWarn.append(type);
			emptyWarn.append(": ");
			if(!type.equalsIgnoreCase("mem")) {
				if(type.equalsIgnoreCase("tdb")) {
					emptyWarn.append("dbDir: ");
					emptyWarn.append(params.get("dbDir"));
					emptyWarn.append(" ");
				} else {
					emptyWarn.append("dbDir: ");
					emptyWarn.append(params.get("dbDir"));
					emptyWarn.append(" ");
				}
			}
			emptyWarn.append("modelName: ");
			emptyWarn.append(jc.getModelName());
			JenaConnect.log.warn(emptyWarn.toString());
		}
		return jc;
	}
private static JenaConnect build ( Map < String , String > params ) throws IOException { if ( ( params == null ) || params . isEmpty ( ) ) { return null ; } if ( ! params . containsKey ( "type" ) ) { throw new IllegalArgumentException ( "Must specify 'type' parameter {'rdb','sdb','tdb','file','mem'}" ) ; } String type = params . get ( "type" ) ; JenaConnect jc ; if ( type . equalsIgnoreCase ( "sdb" ) ) { jc = new SDBJenaConnect ( params . get ( "dbUrl" ) , params . get ( "dbUser" ) , params . get ( "dbPass" ) , params . get ( "dbType" ) , params . get ( "dbClass" ) , params . get ( "dbLayout" ) , params . get ( "modelName" ) ) ; } else if ( type . equalsIgnoreCase ( "tdb" ) ) { jc = new TDBJenaConnect ( params . get ( "dbDir" ) , params . get ( "modelName" ) ) ; } else { throw new IllegalArgumentException ( "unknown type: " + type ) ; } if ( ( params . containsKey ( "checkEmpty" ) && ( params . get ( "checkEmpty" ) . toLowerCase ( ) == "true" ) ) && jc . isEmpty ( ) ) { StringBuilder emptyWarn = new StringBuilder ( "jena model empty! " ) ; emptyWarn . append ( type ) ; emptyWarn . append ( ": " ) ; if ( ! type . equalsIgnoreCase ( "mem" ) ) { if ( type . equalsIgnoreCase ( "tdb" ) ) { emptyWarn . append ( "dbDir: " ) ; emptyWarn . append ( params . get ( "dbDir" ) ) ; emptyWarn . append ( " " ) ; } else { emptyWarn . append ( "dbDir: " ) ; emptyWarn . append ( params . get ( "dbDir" ) ) ; emptyWarn . append ( " " ) ; } } emptyWarn . append ( "modelName: " ) ; emptyWarn . append ( jc . getModelName ( ) ) ; JenaConnect . log . warn ( emptyWarn . toString ( ) ) ; } return jc ; }
Build a JenaConnect based on the given parameter set
 @param params the value map
 @return the JenaConnect
 @throws IOException error connecting to jena model
Build a JenaConnect based on the given parameter set @param params the value map @return the JenaConnect @throws IOException error connecting to jena model
// for(String param : params.keySet()) { // log.debug(param+" => "+params.get(param)); // }