Example usage for java.lang String toUpperCase

List of usage examples for java.lang String toUpperCase

Introduction

In this page you can find the example usage for java.lang String toUpperCase.

Prototype

public String toUpperCase() 

Source Link

Document

Converts all of the characters in this String to upper case using the rules of the default locale.

Usage

From source file:com.eryansky.common.web.servlet.ValidateCodeServlet.java

/**
 * ?./*from   w w  w  . jav  a  2  s. c  o  m*/
 */
public static boolean validate(HttpServletRequest request, String validateCode) {
    String code = (String) request.getSession().getAttribute(SysConstants.SESSION_VALIDATE_CODE);
    return validateCode.toUpperCase().equalsIgnoreCase(code);
}

From source file:org.blocks4j.reconf.infra.http.layer.SimpleHttpClient.java

private static SimpleHttpResponse execute(CloseableHttpClient httpClient, SimpleHttpRequest request,
        long timeout, TimeUnit timeunit) throws Exception {

    RequestTask task = new RequestTask(httpClient, request);
    Future<SimpleHttpResponse> futureResponse = null;

    try {//from w w w.jav a 2  s .  c  om
        futureResponse = requestExecutor.submit(task);
        return futureResponse.get(timeout, timeunit);

    } catch (TimeoutException e) {
        httpClient.close();
        RequestLine line = request.getRequestLine();
        String method = request.getMethod();

        if (line != null && method != null) {
            throw new TimeoutException(msg.format("error.complete", method.toUpperCase(), line.getUri(),
                    timeout, timeunit.toString().toLowerCase()));

        } else {
            throw new TimeoutException(msg.format("error", timeout, timeunit.toString().toLowerCase()));
        }

    } catch (Exception e) {
        httpClient.close();
        throw e;

    } finally {
        if (futureResponse != null) {
            futureResponse.cancel(true);
        }
    }
}

From source file:gov.nih.nci.cabig.ctms.web.taglibs.Functions.java

public static String capitalize(String text) {
    if (org.apache.commons.lang.StringUtils.isBlank(text))
        return text;
    if (text.length() == 1)
        return text.toUpperCase();
    return new StringBuffer(text.substring(0, 1).toUpperCase()).append(text.substring(1)).toString();
}

From source file:es.logongas.util.seguridad.CodigoVerificacionSeguro.java

/**
 * Crea un cdigo de verificacin seguro nico en base al String con el
 * valor//from  w w  w . j a v a 2  s  .c o  m
 *
 * @param valor Este valor se obtiene de unba instancia de llamar al mtodo
 * getValor()
 * @return El cdigo de verificacin seguro
 */
public static CodigoVerificacionSeguro getInstance(String valor) {
    return new CodigoVerificacionSeguro(valor.toUpperCase());
}

From source file:com.alibaba.rocketmq.tools.command.MQAdminStartup.java

private static SubCommand findSubCommand(final String name) {
    for (SubCommand cmd : subCommandList) {
        if (cmd.commandName().toUpperCase().equals(name.toUpperCase())) {
            return cmd;
        }/*from w w  w.  j a va2 s . co m*/
    }

    return null;
}

From source file:com.netcrest.pado.internal.security.AESCipher.java

public static String encryptUserTextToHex(String clearText) throws Exception {
    byte[] buf = encryptUserTextToBinary(clearText);
    String hexEncrypted = Hex.encodeHexString(buf);
    return hexEncrypted.toUpperCase();
}

From source file:com.netcrest.pado.internal.security.AESCipher.java

public static String encryptTextToHex(String clearText) throws Exception {
    byte[] buf = encryptTextToBinary(clearText);
    String hexEncrypted = Hex.encodeHexString(buf);
    return hexEncrypted.toUpperCase();
}

From source file:net.certiv.antlr.project.util.Strings.java

public static String titleCase(String word) {
    if (word == null || word.length() == 0)
        return "";
    if (word.length() == 1)
        return word.toUpperCase();
    return word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();
}

From source file:de.arago.rike.commons.util.ViewHelper.java

public static String getStatus(String what) {
    return statusNames.get(what.toUpperCase());
}

From source file:de.arago.rike.commons.util.ViewHelper.java

public static String getColor(String what) {
    return statusColors.get(what.toUpperCase());
}