List of usage examples for org.apache.commons.configuration.plist PropertyListConfiguration containsKey
public boolean containsKey(String key)
From source file:edu.isi.wings.portal.classes.config.Config.java
private void initializePortalConfig(HttpServletRequest request) { this.contextRootPath = request.getContextPath(); PropertyListConfiguration serverConfig = getPortalConfiguration(request); this.storageDirectory = serverConfig.getString("storage.local"); this.tdbDirectory = serverConfig.getString("storage.tdb"); this.serverUrl = serverConfig.getString("server"); this.dotFile = serverConfig.getString("graphviz"); this.clients = serverConfig.getString("clients"); this.dataOntologyUrl = serverConfig.getString("ontology.data"); this.componentOntologyUrl = serverConfig.getString("ontology.component"); this.workflowOntologyUrl = serverConfig.getString("ontology.workflow"); this.executionOntologyUrl = serverConfig.getString("ontology.execution"); this.resourceOntologyUrl = serverConfig.getString("ontology.resource"); if (serverConfig.containsKey("light-reasoner")) this.isLightReasoner = serverConfig.getBoolean("light-reasoner"); this.exportCommunityUrl = serverUrl + contextRootPath + exportServletPath + "/" + communityRelativeDir; this.communityPath = contextRootPath + "/" + usersRelativeDir + "/" + communityRelativeDir; this.communityDir = storageDirectory + File.separator + communityRelativeDir; // Create communityDir (if it doesn't exist) File uf = new File(this.communityDir); if (!uf.exists() && !uf.mkdirs()) System.err.println("Cannot create community directory : " + uf.getAbsolutePath()); // Load engine configurations this.engines = new HashMap<String, ExeEngine>(); List<HierarchicalConfiguration> enginenodes = serverConfig.configurationsAt("execution.engine"); for (HierarchicalConfiguration enode : enginenodes) { ExeEngine engine = this.getExeEngine(enode); this.engines.put(engine.getName(), engine); }/*from w ww.j ava 2 s. c o m*/ // Add in the distributed engine if it doesn't already exist if (!this.engines.containsKey("Distributed")) { ExeEngine distengine = new ExeEngine("Distributed", DistributedExecutionEngine.class.getCanonicalName(), ExeEngine.Type.BOTH); this.engines.put(distengine.getName(), distengine); this.addEngineConfig(serverConfig, distengine); try { serverConfig.save(this.configFile); } catch (Exception e) { e.printStackTrace(); } } // Load publishing configuration if (serverConfig.containsKey("publisher.url")) { String publishUrl = serverConfig.getString("publisher.url"); String tstoreUrl = serverConfig.getString("publisher.triple-store"); String uploadUrl = serverConfig.getString("publisher.upload-server.url"); String uploadDir = serverConfig.getString("publisher.upload-server.directory"); String uploadHost = serverConfig.getString("publisher.upload-server.host"); String uploadUserId = serverConfig.getString("publisher.upload-server.userid"); String uploadKey = serverConfig.getString("publisher.upload-server.private-key"); String sizeString = serverConfig.getString("publisher.upload-server.max-upload-size"); this.publisher = new Publisher(); this.publisher.setUrl(publishUrl); this.publisher.setTstoreUrl(tstoreUrl); ServerDetails upserver = new ServerDetails(); upserver.setUrl(uploadUrl); upserver.setHostUserId(uploadUserId); upserver.setDirectory(uploadDir); upserver.setHost(uploadHost); upserver.setPrivateKey(uploadKey); if (sizeString != null) { long size = this.getSizeFromString(sizeString); upserver.setMaxUploadSize(size); } this.publisher.setUploadServer(upserver); } }