List of usage examples for java.lang String toLowerCase
public String toLowerCase()
From source file:com.norbl.util.StringUtil.java
public static boolean isValidBooleanFlag(String value) { String lv = value.toLowerCase(); return (lv.equals("true") || lv.equals("false")); }
From source file:com.thinkbiganalytics.nifi.feedmgr.NifiEnvironmentProperties.java
/** * Return the property key from NiFi that can work with the application.properties * * @param nifiPropertyKey the Nifi property * @return the formatted property to work with the application.properties *//*from w ww .j a v a 2 s . c o m*/ private static String nifiPropertyToEnvironmentProperty(String nifiPropertyKey) { String name = nifiPropertyKey.toLowerCase().trim().replaceAll(" +", "_"); name = name.toLowerCase(); return name; }
From source file:gov.nih.nci.ncicb.tcga.dcc.qclive.common.util.DirectoryListerImpl.java
/** * Convenience method to statically get list of files in dir by extension. * @param dirName the directory in which to look * @param extension the extension the files must have * @return array of File objects/*from w w w. j av a2 s.c om*/ */ public static File[] getFilesByExtension(final String dirName, final String extension) { final File dir = new File(dirName); // It is also possible to filter the list of returned files. // This does not return any files that start with `.'. final FilenameFilter filter = new FilenameFilter() { public boolean accept(final File dir, final String name) { return name.toLowerCase().endsWith(extension.toLowerCase()) && !name.startsWith("."); } }; return dir.listFiles(filter) != null ? dir.listFiles(filter) : null; }
From source file:Main.java
/** * Print class name and its parent name of an object * * @param obj//from w w w . j a va 2 s. c o m */ public final static String getClassInheritence(Object obj) { if (obj == null) { return null; } StringBuilder stb = new StringBuilder(); Class<?> cls = obj.getClass(); String name = cls.getSimpleName(); stb.append("["); stb.append(String.valueOf(obj)); stb.append(":"); while (!name.toLowerCase().equals("object")) { stb.append(name); stb.append("<-"); cls = cls.getSuperclass(); name = cls.getSimpleName(); } stb.append("]"); return stb.toString(); }
From source file:lucee.runtime.net.http.MultiPartResponseUtils.java
private static String extractBoundary(String contentTypeHeader, String defaultValue) { if (contentTypeHeader == null) return defaultValue; String[] headerSections = ListUtil.listToStringArray(contentTypeHeader, ';'); for (String section : headerSections) { String[] subHeaderSections = ListUtil.listToStringArray(section, '='); String headerName = subHeaderSections[0].trim(); if (headerName.toLowerCase().equals("boundary")) { return subHeaderSections[1].replaceAll("^\"|\"$", ""); }// w ww. jav a 2s. c o m } return defaultValue; }
From source file:Main.java
/** * Returns itrator and filters for lower case. * /* w ww. ja v a 2 s. com*/ * @param <T> * Class for list where you get random item. * @param list * Returns and itrator over the elements of T. * @param filter * Filters for lower case. */ public static <T extends Iterable<String>> void filter(T list, String filter) { Iterator<? extends String> strI = list.iterator(); while (strI.hasNext()) { String str = strI.next(); if (!str.toLowerCase().contains(filter.toLowerCase())) { strI.remove(); } } }
From source file:com.afrisoftech.lib.PDF2ExcelConverter.java
private static String getOutputFilename(String pdfFilename, String suffix) { if (pdfFilename.length() >= 5 && pdfFilename.toLowerCase().endsWith(".pdf")) { return pdfFilename.substring(0, pdfFilename.length() - 4) + "." + suffix; } else {/*from w w w .ja v a2 s.c o m*/ return pdfFilename + "." + suffix; } }
From source file:de.tudarmstadt.ukp.dkpro.core.api.resources.CompressionUtils.java
/** * Get an uncompressed input stream for a given input stream created for a particular location. * // w w w. ja v a2s .co m * @param aLocation a resource location (e.g. a path, url, etc.) * @param aStream a raw stream of potentially compressed data. * @return stream wrapped with a decompressing stream. */ public static InputStream getInputStream(String aLocation, InputStream aStream) throws IOException { String lcLocation = aLocation.toLowerCase(); if (lcLocation.endsWith(GZIP.getExtension())) { return new GZIPInputStream(aStream); } else if (lcLocation.endsWith(BZIP2.getExtension()) || lcLocation.endsWith(".bzip2")) { return new BZip2CompressorInputStream(aStream); } else if (lcLocation.endsWith(XZ.getExtension())) { return new XZCompressorInputStream(aStream); } else { return aStream; } }
From source file:net.portalblockz.portalbot.smarts.SmartListener.java
public static void flushUser(String name) { users.remove(name.toLowerCase()); }
From source file:gsn.storage.SQLUtils.java
public static String extractWhereClause(String pQuery) { int indexOfWhere = pQuery.toLowerCase().indexOf(" where "); if (indexOfWhere < 0) return " true "; String toReturn = pQuery.substring(indexOfWhere + " where".length(), pQuery.length()); return toReturn; }