List of usage examples for java.lang String toLowerCase
public String toLowerCase()
From source file:com.enonic.cms.core.search.IndexValueNormalizer.java
public static String normalizeStringValue(final String stringValue) { if (StringUtils.isBlank(stringValue)) { return ""; }/* www. j a v a2 s .c om*/ return stringValue.toLowerCase(); }
From source file:org.paxml.core.ClasspathResource.java
/** * Extract the path without prefix./*from ww w .j a v a 2s .c om*/ * * @param res * the spring resource * @return the path without prefix. */ private static String getNakedPath(ClassPathResource res) { String path = res.getPath(); String lowrCasePath = path.toLowerCase(); if (lowrCasePath.startsWith(SPRING_PREFIX1)) { return path.substring(SPRING_PREFIX1.length()); } else if (lowrCasePath.startsWith(SPRING_PREFIX2)) { return path.substring(SPRING_PREFIX2.length()); } return path; }
From source file:net.amigocraft.mpt.command.RemoveRepositoryCommand.java
public static void removeRepository(String id) throws MPTException { id = id.toLowerCase(); JSONObject repos = (JSONObject) Main.repoStore.get("repositories"); if (repos.containsKey(id)) { lockStores();/*from www . j a va 2 s . co m*/ repos.remove(id); // remove it from memory File store = new File(Main.plugin.getDataFolder(), "repositories.json"); // get the store file if (!store.exists()) // avoid dumb errors Main.initializeRepoStore(store); try { writeRepositoryStore(); } catch (IOException ex) { ex.printStackTrace(); unlockStores(); throw new MPTException(ERROR_COLOR + "Failed to remove repository from local store!"); } unlockStores(); } else // repo doesn't exist in local store throw new MPTException(ERROR_COLOR + "Cannot find repo with given ID!"); }
From source file:Main.java
public static boolean isPPTFileWithSuffixName(String suffixName) { if (isEmpty(suffixName)) { return false; }/*from w w w. j a va 2s .com*/ suffixName = suffixName.toLowerCase(); if ("ppt".equals(suffixName) || "pptx".equals(suffixName) || "pps".equals(suffixName) || "dps".equals(suffixName)) { return true; } return false; }
From source file:Main.java
public static boolean isVideoWithSuffixName(String suffixName) { if (isEmpty(suffixName)) { return false; }//from w w w. ja v a 2 s .c o m suffixName = suffixName.toLowerCase(); if ("video".equals(suffixName) || "wmv".equals(suffixName) || "3gp".equals(suffixName) || "mp4".equals(suffixName) || "rmvb".equals(suffixName) || "avi".equals(suffixName)) { return true; } return false; }
From source file:Main.java
public static boolean isImageWithSuffixName(String suffixName) { if (isEmpty(suffixName)) { return false; }// w w w . jav a 2s.c om suffixName = suffixName.toLowerCase(); if ("jpg".equals(suffixName) || "jpeg".equals(suffixName) || "png".equals(suffixName) || "bmp".equals(suffixName) || "gif".equals(suffixName) || "tif".equals(suffixName)) { return true; } return false; }
From source file:fr.gael.dhus.util.UnZip.java
public static boolean supported(String file) { boolean is_supported = file.toLowerCase().endsWith(".zip")/* || file.toLowerCase ().endsWith (".tar") || file.toLowerCase ().endsWith (".tgz") || file.toLowerCase ().endsWith (".tar.gz")*/; File fileObject = new File(file); is_supported &= fileObject.exists() && fileObject.isFile(); return is_supported; }
From source file:Main.java
public static boolean isImage(String extension) { if (extension == null || extension.equals("")) return false; extension = extension.toLowerCase(); switch (extension) { case "jpg": case "jpeg": case "png": case "gif": case "bmp": return true; default://from ww w . j av a2 s . co m return false; } }
From source file:Main.java
public static String aggregatedTextStartsWith(final String text) { return format("starts-with(%s, '%s')", translateTextForPath("normalize-space(string(.))"), text.toLowerCase()); }
From source file:Main.java
public static boolean isAudioWithSuffixName(String suffixName) { if (isEmpty(suffixName)) { return false; }//from ww w . j a v a 2 s. c om suffixName = suffixName.toLowerCase(); if ("audio".equals(suffixName) || "mp3".equals(suffixName) || "wma".equals(suffixName) || "wav".equals(suffixName) || "ogg".equals(suffixName) || "m4a".equals(suffixName) || "mid".equals(suffixName) || "xmf".equals(suffixName) || "amr".equals(suffixName) || "aac".equals(suffixName)) { return true; } return false; }