Example usage for java.lang Boolean getBoolean

List of usage examples for java.lang Boolean getBoolean

Introduction

In this page you can find the example usage for java.lang Boolean getBoolean.

Prototype

public static boolean getBoolean(String name) 

Source Link

Document

Returns true if and only if the system property named by the argument exists and is equal to, ignoring case, the string "true" .

Usage

From source file:org.wso2.carbon.analytics.dataservice.core.AnalyticsDataPurgingDeployer.java

@Override
public void undeployArtifacts(CarbonApplication carbonApplication, AxisConfiguration axisConfiguration)
        throws DeploymentException {
    if (Boolean.getBoolean(Constants.DISABLE_ANALYTICS_DATA_PURGING_JVM_OPTION)) {
        return;/*  www.j a v  a  2  s  .  co  m*/
    }
    List<Artifact.Dependency> artifacts = carbonApplication.getAppConfig().getApplicationArtifact()
            .getDependencies();
    for (Artifact.Dependency dep : artifacts) {
        Artifact artifact = dep.getArtifact();
        if (artifact == null) {
            continue;
        }
        if (TYPE.equals(artifact.getType())) {
            List<CappFile> files = artifact.getFiles();
            if (files.size() != 1) {
                log.error("Purging artifact must have a single XML file to be deployed. But " + files.size()
                        + " " + "files found");
                continue;
            }
            if (AppDeployerConstants.DEPLOYMENT_STATUS_DEPLOYED.equals(artifact.getDeploymentStatus())) {
                String fileName = artifact.getFiles().get(0).getName();
                String artifactPath = artifact.getExtractedPath() + File.separator + fileName;
                deletePurgingTasks(artifactPath);
                artifact.setDeploymentStatus(AppDeployerConstants.DEPLOYMENT_STATUS_PENDING);
            }
        }
    }
}

From source file:org.apache.cassandra.utils.JMXServerUtils.java

private static void configureRMIRegistry(int port, Map<String, Object> env) throws RemoteException {
    Exporter exporter = (Exporter) env.get(RMIExporter.EXPORTER_ATTRIBUTE);
    // If ssl is enabled, make sure it's also in place for the RMI registry
    // by using the SSL socket factories already created and stashed in env
    if (Boolean.getBoolean("com.sun.management.jmxremote.ssl")) {
        registry = new Registry(port,
                (RMIClientSocketFactory) env.get(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE),
                (RMIServerSocketFactory) env.get(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE),
                exporter.connectorServer);
    } else {/*  ww  w  .  j  a  v a  2 s . co  m*/
        registry = new Registry(port, exporter.connectorServer);
    }
}

From source file:org.grouplens.grapht.util.ClassProxy.java

public static boolean isSerializationPermissive() {
    return Boolean.getBoolean("grapht.deserialization.permissive");
}

From source file:com.heliosdecompiler.bootstrapper.Bootstrapper.java

private static File locateBootstrapperFile() {
    ProtectionDomain protectionDomain = Bootstrapper.class.getProtectionDomain();
    if (protectionDomain == null) {
        JOptionPane.showMessageDialog(null,
                "Error: Could not locate Bootstrapper. (ProtectionDomain was null)");
        throw new RuntimeException();
    }/*from www  .j  a  va 2 s.c om*/
    CodeSource codeSource = protectionDomain.getCodeSource();
    if (codeSource == null) {
        JOptionPane.showMessageDialog(null, "Error: Could not locate Bootstrapper. (CodeSource was null)");
        throw new RuntimeException();
    }
    URL url = codeSource.getLocation();
    if (url == null) {
        JOptionPane.showMessageDialog(null, "Error: Could not locate Bootstrapper. (Location was null)");
        throw new RuntimeException();
    }
    try {
        URI uri = url.toURI();
        File file = new File(uri.getPath());
        if (file.isDirectory()) {
            if (!Boolean.getBoolean("com.heliosdecompiler.isDebugging")) {
                JOptionPane.showMessageDialog(null,
                        "Error: Could not locate Bootstrapper. (File is directory)");
                throw new RuntimeException(file.getAbsolutePath());
            } else {
                System.out.println(
                        "Warning: Could not locate bootstrapper but com.heliosdecompiler.isDebugging was set to true");
            }
        } else if (!file.exists()) {
            JOptionPane.showMessageDialog(null, "Error: Could not locate Bootstrapper. (File does not exist)");
            throw new RuntimeException();
        } else if (!file.canRead()) {
            JOptionPane.showMessageDialog(null, "Error: Could not locate Bootstrapper. (File is not readable)");
            throw new RuntimeException();
        }
        return file;
    } catch (URISyntaxException e) {
        JOptionPane.showMessageDialog(null, "Error: Could not locate Bootstrapper. (URISyntaxException)");
        throw new RuntimeException();
    }
}

From source file:org.apache.geode.internal.process.LocalProcessLauncher.java

private static boolean ignoreIsPidAlive() {
    return Boolean.getBoolean(PROPERTY_IGNORE_IS_PID_ALIVE);
}

From source file:org.apache.karaf.looptc.LoopTcTest.java

@Configuration
public static Option[] paxConfiguration() {
    String basedir = System.getProperty("basedir", ".");
    String version = System.getProperty("project.version");
    String karafVersion = System.getProperty("karaf.version");
    MavenUrlReference karafStandardRepo = maven().groupId("org.apache.karaf.features").artifactId("standard")
            .version(karafVersion).classifier("features").type("xml");
    MavenUrlReference cxfRepo = maven().groupId("org.apache.cxf.karaf").artifactId("apache-cxf")
            .versionAsInProject().classifier("features").type("xml");

    return new Option[] {
            mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpclient-osgi")
                    .versionAsInProject(),
            mavenBundle().groupId("org.apache.httpcomponents").artifactId("httpcore-osgi").versionAsInProject(),

            //configureConsole().ignoreLocalConsole(),
            keepRuntimeFolder(), logLevel(LogLevelOption.LogLevel.DEBUG),
            editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port",
                    System.getProperty("karaf.port")),
            //editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote", "true"),
            editConfigurationFilePut("etc/org.ops4j.pax.logging.cfg",
                    "log4j.category.org.ops4j.pax.url.mvn.internal.AetherBasedResolver", "ERROR"),
            karafDistributionConfiguration().karafVersion(karafVersion).name("Apache Karaf")
                    .frameworkUrl(maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip")
                            .versionAsInProject())
                    .unpackDirectory(new File(basedir, "target/pax")),
            features(karafStandardRepo, "http"), features(cxfRepo, "cxf"),
            features(// w  w w  .  j a  va  2s . c  o  m
                    maven("org.apache.karaf", "tc-service").classifier("features").type("xml").version(version),
                    "tc-service"),
            when(Boolean.getBoolean("karaf.debug")).useOptions(debugConfiguration()), junitBundles(),
            systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
            systemProperty("org.ops4j.pax.exam.rbc.rmi.host").value("localhost"),
            propagateSystemProperties("test.worker.port", "test.frontend.port") };
}

From source file:org.talend.commons.utils.network.NetworkUtil.java

public static void updateSvnkitConfigureFile(String srcFilePath, String destFilePath) {
    // SVNFileUtil getSystemApplicationDataPath C:\ProgramData\\Application Data
    // Note:ProgramData:Starting with Windows 10,this setting can no longer be used in provisioning packages.
    String osName = System.getProperty("os.name");//$NON-NLS-1$
    String osNameLC = osName == null ? null : osName.toLowerCase();
    boolean windows = osName != null && osNameLC.indexOf("windows") >= 0;//$NON-NLS-1$
    if (windows && Boolean.getBoolean("http.proxySet")) {//$NON-NLS-1$
        FileCopyUtils.copy(srcFilePath + "\\servers", destFilePath + "\\servers");//$NON-NLS-1$//$NON-NLS-2$
    }// w ww.  j a v a 2  s  . c o  m
}

From source file:org.apache.camel.management.DefaultManagementAgent.java

protected void finalizeSettings() {
    if (registryPort == null) {
        registryPort = Integer.getInteger(JmxSystemPropertyKeys.REGISTRY_PORT, DEFAULT_REGISTRY_PORT);
    }//from   w  ww. jav  a2 s.com

    if (connectorPort == null) {
        connectorPort = Integer.getInteger(JmxSystemPropertyKeys.CONNECTOR_PORT, DEFAULT_CONNECTION_PORT);
    }

    if (mBeanServerDefaultDomain == null) {
        mBeanServerDefaultDomain = System.getProperty(JmxSystemPropertyKeys.DOMAIN, DEFAULT_DOMAIN);
    }

    if (mBeanObjectDomainName == null) {
        mBeanObjectDomainName = System.getProperty(JmxSystemPropertyKeys.MBEAN_DOMAIN, DEFAULT_DOMAIN);
    }

    if (serviceUrlPath == null) {
        serviceUrlPath = System.getProperty(JmxSystemPropertyKeys.SERVICE_URL_PATH, DEFAULT_SERVICE_URL_PATH);
    }

    if (createConnector == null) {
        createConnector = Boolean.getBoolean(JmxSystemPropertyKeys.CREATE_CONNECTOR);
    }

    // "Use platform mbean server" is true by default
    if (System.getProperty(JmxSystemPropertyKeys.USE_PLATFORM_MBS) != null) {
        usePlatformMBeanServer = Boolean.getBoolean(JmxSystemPropertyKeys.USE_PLATFORM_MBS);
    }

    if (onlyRegisterProcessorWithCustomId == null) {
        onlyRegisterProcessorWithCustomId = Boolean
                .getBoolean(JmxSystemPropertyKeys.ONLY_REGISTER_PROCESSOR_WITH_CUSTOM_ID);
    }
}

From source file:com.streamsets.datacollector.util.ClusterUtil.java

public static void cleanUpYarnDirs(String testName) throws IOException {
    if (!Boolean.getBoolean(MiniSDCTestingUtility.PRESERVE_TEST_DIR)) {
        MiniSDCTestingUtility.deleteDir(new File(new File(System.getProperty("user.dir"), "target"), testName));
    }//w w  w  .  j a  va  2  s. c  om
}

From source file:org.josso.gateway.protocol.handler.NtlmProtocolHandler.java

public void setInsecureBasic(String insecureBasic) {
    this.setInsecureBasic(Boolean.getBoolean(insecureBasic));
}