Example usage for java.lang Boolean valueOf

List of usage examples for java.lang Boolean valueOf

Introduction

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

Prototype

public static Boolean valueOf(String s) 

Source Link

Document

Returns a Boolean with a value represented by the specified string.

Usage

From source file:com.google.uzaygezen.core.SelectiveFilter.java

@Override
public int hashCode() {
    return 31 * filter.hashCode() + Boolean.valueOf(potentialOverSelectivity).hashCode();
}

From source file:eu.optimis.tf.sp.service.SPOperation.java

public SPOperation() {
    production = Boolean.valueOf(PropertiesUtils.getProperty("TRUST", "production"));
    rate = Double.valueOf(PropertiesUtils.getProperty("TRUST", "maxRate"));
}

From source file:com.acc.storefront.security.impl.DefaultCommerceRedirectStrategy.java

@Override
public void sendRedirect(final HttpServletRequest request, final HttpServletResponse response, final String url)
        throws IOException {
    String redirectUrl = url;/*w  ww.j  a v a2  s.c o m*/

    if (Boolean.valueOf(checkoutFlowFacade.isExpressCheckoutEnabledForStore())
            && StringUtils.isNotEmpty(request.getParameter("expressCheckoutEnabled"))) {
        redirectUrl = getExpressTargetUrl();
    }
    super.sendRedirect(request, response, redirectUrl);
}

From source file:net.sf.zekr.engine.server.DefaultHttpServer.java

public void run() {
    try {//from w ww  . j  a  va 2s  .  c  om
        logger.info("Starting HTTP server...");
        final boolean denyRemoteAccess = props.getBoolean("server.http.denyRemoteAccess", true);
        httpFacade = new NanoHttpd(getServerPort(), denyRemoteAccess) {
            public Response serve(String uri, String method, Properties header, Properties parms) {
                if (!hasAccessPermission(uri)) {
                    return new Response(HTTP_FORBIDDEN, MIME_PLAINTEXT, "Access denied.");
                }
                if (Boolean.valueOf(props.getString("server.http.log")).booleanValue())
                    logger.debug("serving URI: " + uri);
                String path = toRealPath(uri.substring(1));
                if (!new File(path).exists())
                    return new Response(HTTP_NOTFOUND, MIME_PLAINTEXT, "File not found.");
                String baseDir = FilenameUtils.getFullPath(path);
                String fileName = FilenameUtils.getName(path);
                return serveFile(fileName, header, new File(baseDir), false);
            }

            private boolean hasAccessPermission(String uri) {
                if (denyRemoteAccess) {
                    return true;
                } else {
                    return isAllowedUri(uri);
                }
            }

            private boolean isAllowedUri(String uri) {
                return (uri.indexOf("..") == -1) && (uri.indexOf(":/") == -1) && (uri.indexOf(":\\") == -1);
            }
        };
        logger.info("HTTP server is listening on: " + getUrl());
    } catch (IOException ioe) {
        logger.error("HTTP server cannot be started due to the next error.");
        logger.implicitLog(ioe);
        return;
    }
    //      while (true) {
    //         try {
    //            // do nothing, there is a separate waiting thread for each request.
    //            Thread.sleep(1000);
    //         } catch (InterruptedException e) {
    //            logger.info("HTTP Server terminated.");
    //         }
    //      }
}

From source file:com.adaptris.core.services.jdbc.BooleanStatementParameter.java

@Override
protected Boolean convertToType(Object o) {
    return Boolean.valueOf(BooleanUtils.toBoolean((String) o));
}

From source file:com.streamreduce.core.service.UserServiceIT.java

@Test
@Ignore("Integration Tests depended on sensitive account keys, ignoring until better harness is in place.")
public void testCreateUser_PersistDefaultConfig() throws Exception {
    //Test that createUser persists a default config

    User user = TestUtils.createTestUser();
    user.setAccount(testAccount);//from  w  w  w. java 2 s.c o m
    ReflectionTestUtils.setField(user, "userConfig", null);
    ObjectId userId = userService.createUser(user).getId();
    User retrievedUser = userService.getUserById(userId);
    Map<String, Object> config = retrievedUser.getConfig();
    assertTrue(Boolean.valueOf(config.get(User.ConfigKeys.RECEIVES_COMMENT_NOTIFICATIONS).toString()));
    assertTrue(Boolean.valueOf(config.get(User.ConfigKeys.RECEIVES_NEW_MESSAGE_NOTIFICATIONS).toString()));
}

From source file:com.khartec.waltz.web.Main.java

private void startHttpServer() {
    String listenPortStr = System.getProperty("waltz.port", "8443");
    boolean sslEnabled = Boolean.valueOf(System.getProperty("waltz.ssl.enabled", "false"));

    String home = System.getProperty("user.home");
    boolean devMode = Boolean.valueOf(System.getProperty("waltz.dev.mode", "false"));

    final ServerMode mode = devMode ? ServerMode.DEV : ServerMode.DEPLOY;

    System.out.println("--WALTZ---------------------------------------------");
    System.out.println("Home is: " + home);
    System.out.println("Mode is: " + mode);
    System.out.println("Listening on port: " + listenPortStr);
    System.out.println("SSL Enabled: " + sslEnabled);
    System.out.println("----------------------------------------------------");

    if (sslEnabled) {
        Spark.secure(home + "/.waltz/keystore.jks", "password", null, null);
    }/*from w  w  w . ja  v a  2  s.  c  o  m*/

    int listenPort = Integer.parseInt(listenPortStr);
    port(listenPort);

    start(mode);
}

From source file:com.consol.citrus.functions.core.ReadFileResourceFunction.java

@Override
public String execute(List<String> parameterList, TestContext context) {
    if (CollectionUtils.isEmpty(parameterList)) {
        throw new InvalidFunctionUsageException("Missing file path function parameter");
    }/*from ww  w  .  j  a va 2 s. c o m*/

    boolean base64 = parameterList.size() > 1 ? Boolean.valueOf(parameterList.get(1)) : false;

    try {
        if (base64) {
            return Base64.encodeBase64String(FileCopyUtils.copyToByteArray(
                    FileUtils.getFileResource(parameterList.get(0), context).getInputStream()));
        } else {
            return context.replaceDynamicContentInString(
                    FileUtils.readToString(FileUtils.getFileResource(parameterList.get(0), context)));
        }
    } catch (IOException e) {
        throw new CitrusRuntimeException("Failed to read file", e);
    }
}

From source file:functionaltests.RestfulSchedulerFreezeTest.java

@Test
public void testFreezeScheduler() throws Exception {
    String resourceUrl = getResourceUrl("freeze");
    HttpPut httpPut = new HttpPut(resourceUrl);
    setSessionHeader(httpPut);//from w w  w .  j  av  a 2 s.co m
    HttpResponse response = executeUriRequest(httpPut);
    assertHttpStatusOK(response);
    assertTrue(Boolean.valueOf(getContent(response)));
    Scheduler scheduler = RestFuncTHelper.getScheduler();
    assertEquals(SchedulerStatus.FROZEN, scheduler.getStatus());
}

From source file:org.jasypt.spring31.xml.encryption.EncryptablePropertyOverrideBeanDefinitionParser.java

@Override
protected void doParse(final Element element, final BeanDefinitionBuilder builder) {

    super.doParse(element, builder);
    builder.addPropertyValue("ignoreInvalidKeys", Boolean.valueOf(element.getAttribute("ignore-unresolvable")));

    final String encryptorBeanName = element.getAttribute(ENCRYPTOR_ATTRIBUTE);
    if (StringUtils.hasText(encryptorBeanName)) {
        builder.addConstructorArgReference(encryptorBeanName);
    }/*w ww  . ja va 2  s .  co m*/

}