List of usage examples for java.lang Boolean getBoolean
public static boolean getBoolean(String name)
From source file:org.dawnsci.commandserver.ui.view.StatusQueueView.java
private IContentProvider createContentProvider() { return new IStructuredContentProvider() { @Override//from www. j ava2s .c o m public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { queue = (Map<String, StatusBean>) newInput; } @Override public void dispose() { if (queue != null) queue.clear(); } @Override public Object[] getElements(Object inputElement) { if (queue == null) return new StatusBean[] { StatusBean.EMPTY }; final List<StatusBean> retained = new ArrayList<StatusBean>(queue.values()); // This preference is not secure people could hack DAWN to do this. if (!Boolean.getBoolean("org.dawnsci.commandserver.ui.view.showWholeQueue")) { // Old fashioned loop. In Java8 we will use a predicate... final String userName = getUserName(); for (Iterator it = retained.iterator(); it.hasNext();) { StatusBean statusBean = (StatusBean) it.next(); if (statusBean.getUserName() == null) continue; if (!showEntireQueue) { if (!userName.equals(statusBean.getUserName())) it.remove(); } } // This form of filtering is not at all secure because we // give the full list of the queue to the clients. } return retained.toArray(new StatusBean[retained.size()]); } }; }
From source file:org.apache.hive.beeline.BeeLine.java
/** * Starts the program with redirected input. For redirected output, * setOutputStream() and setErrorStream can be used. * Exits with 0 on success, 1 on invalid arguments, and 2 on any other error * * @param args//from www.ja v a 2s. c om * same as main() * * @param inputStream * redirected input, or null to use standard input */ public static void mainWithInputRedirection(String[] args, InputStream inputStream) throws IOException { BeeLine beeLine = new BeeLine(); try { int status = beeLine.begin(args, inputStream); if (!Boolean.getBoolean(BeeLineOpts.PROPERTY_NAME_EXIT)) { System.exit(status); } } finally { beeLine.close(); } }
From source file:easycare.alc.cuke.steps.esignature.SignInterpretationSteps.java
private void changeInterpretation(HstPatient patient, User physician, DataTable dataTable) { HstData hstData = hstDataRepository.findWithNoData(patient.getEasyCareNumber()); HstInterpretation hstInterpretation = hstInterpretationRepository.findByHstDataId(hstData.getId()); CukeMap map = CukeMap.toCukeMap(dataTable); String interpretationText = map.get("Interpretation"); String prescriptionRequired = map.get("Prescription Required"); hstInterpretation.updateInterpretation(interpretationText, Boolean.getBoolean(prescriptionRequired), physician);/*from w ww . j av a 2 s.co m*/ hstInterpretationRepository.save(hstInterpretation); }
From source file:de.innovationgate.wgpublisher.lucene.LuceneManager.java
private LuceneManager(WGACore core, File dir) throws IOException, DocumentException, WGSystemException { // Set lock directory to WGA temp dir System.setProperty("org.apache.lucene.lockDir", core.getWgaTempDir().getPath()); _dir = dir;/*from w ww. j a v a 2 s .c o m*/ _core = core; // init metakeywords - used during search analysis List<MetaInfo> metaInfoList = new ArrayList<MetaInfo>(); metaInfoList.addAll(WGFactory.getInstance().getMetaInfos(WGContent.class).values()); metaInfoList.addAll(WGFactory.getInstance().getMetaInfos(WGFileMetaData.class).values()); Iterator metaInfos = metaInfoList.iterator(); _metaKeywordFields = new HashSet(); while (metaInfos.hasNext()) { MetaInfo metaInfo = (MetaInfo) metaInfos.next(); //B0000485A if (metaInfo.getLuceneIndexType() == MetaInfo.LUCENE_INDEXTYPE_KEYWORD) { if (!_metaKeywordFields.contains(metaInfo.getName())) { _metaKeywordFields.add(metaInfo.getName()); Iterator synonyms = metaInfo.getSynonyms().iterator(); while (synonyms.hasNext()) { String synonym = (String) synonyms.next(); _metaKeywordFields.add(synonym); } } } } // Add virtual metas _metaKeywordFields.addAll(Arrays.asList(VIRTUALMETAS)); if (Boolean.getBoolean(SYSPROP_USE_CONSTANT_IDF_SIMILARITY)) { _customSimilarity = new ConstantIDFSimilarity(); } else { _customSimilarity = new ContantFieldNormSimilarity(); } }
From source file:io.adeptj.runtime.server.Server.java
/** * Chaining of Undertow {@link HttpHandler} instances as follows. * <p>/*from www.ja v a 2s.c o m*/ * 1. GracefulShutdownHandler * 2. RequestLimitingHandler * 3. AllowedMethodsHandler * 4. PredicateHandler which resolves to either RedirectHandler or SetHeadersHandler * 5. RequestBufferingHandler if request buffering is enabled, wrapped in SetHeadersHandler * 5. And Finally ServletInitialHandler * * @param servletInitialHandler the {@link io.undertow.servlet.handlers.ServletInitialHandler} * @return GracefulShutdownHandler as the root handler */ private GracefulShutdownHandler rootHandler(HttpHandler servletInitialHandler) { Config cfg = Objects.requireNonNull(this.cfgReference.get()); Map<HttpString, String> headers = new HashMap<>(); headers.put(HttpString.tryFromString(HEADER_SERVER), cfg.getString(KEY_HEADER_SERVER)); if (Environment.isDev()) { headers.put(HttpString.tryFromString(HEADER_X_POWERED_BY), Version.getFullVersionString()); } HttpHandler headersHandler = Boolean.getBoolean(SYS_PROP_ENABLE_REQ_BUFF) ? new SetHeadersHandler( new RequestBufferingHandler(servletInitialHandler, Integer.getInteger(SYS_PROP_REQ_BUFF_MAX_BUFFERS, cfg.getInt(KEY_REQ_BUFF_MAX_BUFFERS))), headers) : new SetHeadersHandler(servletInitialHandler, headers); return Handlers.gracefulShutdown(new RequestLimitingHandler( Integer.getInteger(SYS_PROP_MAX_CONCUR_REQ, cfg.getInt(KEY_MAX_CONCURRENT_REQS)), new AllowedMethodsHandler( Handlers.predicate(exchange -> CONTEXT_PATH.equals(exchange.getRequestURI()), Handlers.redirect(TOOLS_DASHBOARD_URI), headersHandler), this.allowedMethods(cfg)))); }
From source file:org.rhq.enterprise.server.core.AgentManagerBean.java
@ExcludeDefaultInterceptors public boolean isAgentVersionSupported(AgentVersion agentVersionInfo) { try {// www .j ava 2 s. co m Properties properties = getAgentUpdateVersionFileContent(); // Prime Directive: whatever agent update the server has installed is the one we support, // so both the version AND build number must match. // For developers, however, we want to allow to be less strict - only version needs to match. String supportedAgentVersion = properties.getProperty(RHQ_AGENT_LATEST_VERSION); if (supportedAgentVersion == null) { throw new NullPointerException("no agent version in file"); } ComparableVersion agent = new ComparableVersion(agentVersionInfo.getVersion()); ComparableVersion server = new ComparableVersion(supportedAgentVersion); if (Boolean.getBoolean("rhq.server.agent-update.nonstrict-version-check")) { return agent.equals(server); } else { String supportedAgentBuild = properties.getProperty(RHQ_AGENT_LATEST_BUILD_NUMBER); return agent.equals(server) && agentVersionInfo.getBuild().equals(supportedAgentBuild); } } catch (Exception e) { log.warn("Cannot determine if agent version [" + agentVersionInfo + "] is supported. Cause: " + e); return false; // assume we can't talk to it } }
From source file:org.openbi.kettle.plugins.refreshtableauextract.RefreshTableauExtract.java
public void setFullRefresh(String n) { fullRefresh = Boolean.getBoolean(n); }
From source file:org.apache.maven.cli.CopyOfMavenCli.java
private void repository(CliRequest cliRequest) throws Exception { if (cliRequest.commandLine.hasOption(CLIManager.LEGACY_LOCAL_REPOSITORY) || Boolean.getBoolean("maven.legacyLocalRepo")) { cliRequest.request.setUseLegacyLocalRepository(true); }/* ww w .j av a 2 s.c om*/ }
From source file:org.openbi.kettle.plugins.refreshtableauextract.RefreshTableauExtract.java
public void setProcessResultFiles(String n) { processResultFiles = Boolean.getBoolean(n); }