List of usage examples for java.lang Boolean getBoolean
public static boolean getBoolean(String name)
From source file:com.autentia.tnt.test.utils.ConfigurationUtilForTesting.java
/** * Return a boolean value representing the value of isUsingExternalCss. * /*from ww w .ja va 2s .c o m*/ * @return */ public boolean isUsingExternalCss() { String valor = getProperty("isUsingExternalCss", "false"); return Boolean.getBoolean(valor); }
From source file:org.apache.jackrabbit.oak.plugins.segment.PartialCompactionMapTest.java
@Test public void benchPut() throws Exception { assumeTrue(Boolean.getBoolean("benchmark.benchPut")); assertHeapSize(4000000000L);//from w w w .j a v a 2 s .c om run(new PutBenchmark(0, 100)); run(new PutBenchmark(10, 100)); run(new PutBenchmark(100, 100)); run(new PutBenchmark(1000, 100)); run(new PutBenchmark(10000, 100)); run(new PutBenchmark(100000, 100)); run(new PutBenchmark(1000000, 100)); }
From source file:com.github.mrstampy.esp.neurosky.MultiConnectionThinkGearSocket.java
/** * Connects to the ThinkGear socket on the specified host, allowing * programmatic control of broadcasting for {@link ThinkGearSocketConnector}s, * and of enabling/disabling remote {@link ThinkGearSocketConnector}s sending * messages to the Neurosky device.// w w w. ja v a 2 s . com * * @param host * @param broadcasting * @param canSendNeuroskyMessages * @throws IOException */ public MultiConnectionThinkGearSocket(String host, boolean broadcasting, boolean canSendNeuroskyMessages) throws IOException { this(host, broadcasting, canSendNeuroskyMessages, Boolean.getBoolean(RAW_DATA_KEY)); }
From source file:org.dogtagpki.server.ca.rest.ProfileService.java
public ProfileData createProfileData(String profileId) throws EBaseException { IProfile profile = getProfile(profileId); ProfileData data = new ProfileData(); data.setAuthenticatorId(profile.getAuthenticatorId()); data.setAuthzAcl(profile.getAuthzAcl()); data.setClassId(ps.getProfileClassId(profileId)); data.setDescription(profile.getDescription(getLocale(headers))); data.setEnabled(ps.isProfileEnable(profileId)); data.setEnabledBy(ps.getProfileEnableBy(profileId)); data.setId(profileId);//from w w w . j a v a 2s . c om data.setName(profile.getName(getLocale(headers))); data.setRenewal(Boolean.getBoolean(profile.isRenewal())); data.setVisible(profile.isVisible()); data.setXMLOutput(Boolean.getBoolean(profile.isXmlOutput())); Enumeration<String> inputIds = profile.getProfileInputIds(); if (inputIds != null) { while (inputIds.hasMoreElements()) { ProfileInput input = createProfileInput(profile, inputIds.nextElement(), getLocale(headers)); if (input == null) continue; data.addProfileInput(input); } } // profile outputs Enumeration<String> outputIds = profile.getProfileOutputIds(); if (outputIds != null) { while (outputIds.hasMoreElements()) { ProfileOutput output = createProfileOutput(profile, outputIds.nextElement(), getLocale(headers)); if (output == null) continue; data.addProfileOutput(output); } } // profile policies Enumeration<String> policySetIds = profile.getProfilePolicySetIds(); if (policySetIds != null) { while (policySetIds.hasMoreElements()) { Vector<ProfilePolicy> pset = new Vector<ProfilePolicy>(); String policySetId = policySetIds.nextElement(); Enumeration<String> policyIds = profile.getProfilePolicyIds(policySetId); while (policyIds.hasMoreElements()) { String policyId = policyIds.nextElement(); pset.add(createProfilePolicy(profile, policySetId, policyId)); } if (!pset.isEmpty()) { data.addProfilePolicySet(policySetId, pset); } } } UriBuilder profileBuilder = uriInfo.getBaseUriBuilder(); URI uri = profileBuilder.path(ProfileResource.class).path("{id}").build(profileId); data.setLink(new Link("self", uri)); return data; }
From source file:org.lockss.test.LockssTestCase.java
public static boolean isKeepTempFiles() { return Boolean.getBoolean("org.lockss.keepTempFiles"); }
From source file:org.apache.jackrabbit.oak.plugins.segment.PartialCompactionMapTest.java
@Test public void benchGet() throws Exception { assumeTrue(Boolean.getBoolean("benchmark.benchGet")); assertHeapSize(4000000000L);//from ww w. j a v a2s . c o m run(new GetBenchmark(0, 100)); run(new GetBenchmark(10, 100)); run(new GetBenchmark(100, 100)); run(new GetBenchmark(1000, 100)); run(new GetBenchmark(10000, 100)); run(new GetBenchmark(100000, 100)); run(new GetBenchmark(1000000, 100)); }
From source file:com.twelvemonkeys.util.ObjectAbstractTestCase.java
protected boolean skipSerializedCanonicalTests() { return Boolean.getBoolean("org.apache.commons.collections:with-clover"); }
From source file:gov.va.isaac.mojos.profileSync.ProfilesMojoBase.java
protected String getPassword() throws MojoExecutionException { if (password == null) { password = System.getProperty(PROFILE_SYNC_PASSWORD_PROPERTY); //still blank, try the passed in param if (StringUtils.isBlank(password)) { password = profileSyncPassword; }/* w w w. j a v a 2 s .c o m*/ //still no password, prompt if allowed if (StringUtils.isBlank(password) && !Boolean.getBoolean(PROFILE_SYNC_NO_PROMPTS)) { Callable<Void> callable = new Callable<Void>() { @Override public Void call() throws Exception { try { if (!disableHintGiven) { System.out.println("To disable remote sync during build, add '-D" + PROFILE_SYNC_DISABLE + "=true' to your maven command"); disableHintGiven = true; } System.out.println("Enter the " + config_.getChangeSetUrlType().name() + " password for the Profiles/Changset remote store: (" + config_.getChangeSetUrl() + "):"); //Use console if available, for password masking Console console = System.console(); if (console != null) { password = new String(console.readPassword()); } else { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); password = br.readLine(); } } catch (IOException e) { throw new MojoExecutionException("Error reading password from console"); } return null; } }; try { Executors.newSingleThreadExecutor(new ThreadFactory() { @Override public Thread newThread(Runnable r) { Thread t = new Thread(r, "User Password Prompt Thread"); t.setDaemon(true); return t; } }).submit(callable).get(2, TimeUnit.MINUTES); } catch (TimeoutException | InterruptedException e) { throw new MojoExecutionException("Password not provided within timeout"); } catch (ExecutionException ee) { throw (ee.getCause() instanceof MojoExecutionException ? (MojoExecutionException) ee.getCause() : new MojoExecutionException("Unexpected", ee.getCause())); } } } return password; }
From source file:com.moss.greenshell.wizard.ProcessPanel.java
public void failCatastrophically(Throwable t) { ScreenAction debugBack = null;// ww w .ja va 2s . c o m if (Boolean.getBoolean("com.moss.greenshell.catastrophe.backButton")) { debugBack = new AbstractScreenAction() { final Screen lastScreen = currentScreen; public void actionPerformed(ActionEvent e) { environment.previous(lastScreen); } }; } next(new PostMortemScreen(t, debugBack, errorDecorators)); }
From source file:eu.eidas.node.auth.metadata.NodeMetadataFetcher.java
protected SecureProtocolSocketFactory hubLocalSslSocketFactory() { HostnameVerifier hostnameVerifier; if (!Boolean.getBoolean(DefaultBootstrap.SYSPROP_HTTPCLIENT_HTTPS_DISABLE_HOSTNAME_VERIFICATION)) { hostnameVerifier = new StrictHostnameVerifier(); } else {/*from w w w. j a v a2 s .c o m*/ hostnameVerifier = org.apache.commons.ssl.HostnameVerifier.ALLOW_ALL; } X509TrustManager trustedCertManager = new X509TrustManager() { @Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { try { return new X509Certificate[] { CertificateUtil.toCertificate(hubSslCertificateString) }; } catch (EIDASSAMLEngineException e) { throw new RuntimeException("Unable to load trusted certificate: ", e); } } @Override public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) { } @Override public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) { } }; TLSProtocolSocketFactory tlsProtocolSocketFactory = new TLSProtocolSocketFactory(null, trustedCertManager, hostnameVerifier) { @Override protected void verifyHostname(Socket socket) throws SSLException { if (socket instanceof SSLSocket) { SSLSocket sslSocket = (SSLSocket) socket; try { sslSocket.startHandshake(); } catch (IOException e) { throw new SSLException(e); } SSLSession sslSession = sslSocket.getSession(); if (!sslSession.isValid()) { throw new SSLException("SSLSession was invalid: Likely implicit handshake failure: " + "Set system property javax.net.debug=all for details"); } super.verifyHostname(sslSocket); } } }; Protocol.registerProtocol("https", new Protocol("https", tlsProtocolSocketFactory, 443)); return tlsProtocolSocketFactory; }