Example usage for java.lang String toLowerCase

List of usage examples for java.lang String toLowerCase

Introduction

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

Prototype

public String toLowerCase() 

Source Link

Document

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

Usage

From source file:com.liferay.alloy.util.ReservedAttributeUtil.java

public static String getSafeName(Attribute attribute) {
    String name = attribute.getName();

    Component component = attribute.getComponent();

    if (isReserved(attribute) && (component != null)) {
        String componentName = component.getName();

        name = componentName.toLowerCase().concat(StringUtils.capitalize(name));
    }//from   www.java  2  s  .co m

    return name;
}

From source file:Main.java

/**
 * Creates a string with the given foreground and backgroundcolor.
 *
 * @param str String to be colorized./*from w  w w .  j  a v a  2 s .c  om*/
 * @param fgc Constant defined color (see constants). Will be textcolor.
 * @param bgc Constant defined color (see constants). Will be backgroundcolor.
 * @return String with internal markup-sequences.
 */
public static String colorizeText(String str, String fgc, String bgc) {
    return INTERNAL_MARKER + fgc + INTERNAL_MARKER + bgc.toLowerCase() + str + INTERNAL_MARKER + RESET_ALL;
}

From source file:Main.java

public static boolean isApkFileWithSuffixName(String suffixName) {
    if (isEmpty(suffixName)) {
        return false;
    }//from w w w  .j av a 2  s .c  o m
    suffixName = suffixName.toLowerCase();
    if ("apk".equals(suffixName)) {
        return true;
    }
    return false;
}

From source file:Main.java

public static boolean isTxtFileWithSuffixName(String suffixName) {
    if (isEmpty(suffixName)) {
        return false;
    }//from w w  w .j  a va  2s. com
    suffixName = suffixName.toLowerCase();
    if ("txt".equals(suffixName)) {
        return true;
    }
    return false;
}

From source file:Main.java

public static int getVersion(Context context) {

    int ver = -1;
    String str = Build.DISPLAY;
    if (TextUtils.isEmpty(str) || !str.toLowerCase().contains("flyme")) {
        return -1;
    }/*from  w w w .  j  a  va 2 s .  c om*/
    try {
        String[] split = str.replaceAll(" ", "").toLowerCase().split("\\.");
        if (split.length < 2) {
            return -1;
        }
        try {
            return (Integer.valueOf(split[0].substring(split[0].length() - 1)).intValue() * 10)
                    + Integer.valueOf(split[1].substring(0, 1)).intValue();
        } catch (Exception e) {

            ver = -1;
            return ver;
        }
    } catch (Exception e2) {
        return ver;
    }
}

From source file:Main.java

public static boolean isZIPFileWithSuffixName(String suffixName) {
    if (isEmpty(suffixName)) {
        return false;
    }//from  w  w w  . ja v a  2s .  c  om
    suffixName = suffixName.toLowerCase();
    if ("zip".equals(suffixName) || "rar".equals(suffixName) || "7z".equals(suffixName)) {
        return true;
    }
    return false;
}

From source file:Main.java

public static boolean isDocFileWithSuffixName(String suffixName) {
    if (isEmpty(suffixName)) {
        return false;
    }/*from  www .j a  v a2  s . c  o  m*/
    suffixName = suffixName.toLowerCase();
    if ("doc".equals(suffixName) || "docx".equals(suffixName) || "wps".equals(suffixName)) {
        return true;
    }
    return false;
}

From source file:Main.java

public static boolean isPdfFileWithSuffixName(String suffixName) {
    if (isEmpty(suffixName)) {
        return false;
    }/*from  w  w  w .  jav a 2  s  .c  om*/
    suffixName = suffixName.toLowerCase();
    if ("pdf".equals(suffixName)) {
        return true;
    }
    return false;
}

From source file:Main.java

/**
 * Check if the params came from response that requires authorization
 * @param statusCode status code of the responce
 * @param wwwAuthenticateHeaders list of WWW-Authenticate headers
 * @return true if status is 401 or 403 and The value of the header starts with 'Bearer' and that it contains ""imfAuthentication""
 *//*from  w  w  w.ja v  a  2s .com*/
private static boolean isAuthorizationRequired(int statusCode, List<String> wwwAuthenticateHeaders) {

    if ((statusCode == 401 || statusCode == 403) && wwwAuthenticateHeaders != null) {

        //It is possible that there will be more then one header for this header-name. This is why we need the loop here.
        for (String header : wwwAuthenticateHeaders) {
            if (header != null && header.toLowerCase().startsWith(BEARER.toLowerCase())
                    && header.toLowerCase().contains(AUTH_SCOPE.toLowerCase())) {
                return true;
            }
        }
    }

    return false;
}

From source file:Main.java

public static boolean isXlsFileWithSuffixName(String suffixName) {
    if (isEmpty(suffixName)) {
        return false;
    }//w ww. j ava2s.com
    suffixName = suffixName.toLowerCase();
    if ("xls".equals(suffixName) || "xlsx".equals(suffixName)) {
        return true;
    }
    return false;
}