out.append ( capitalizeFirstLetter(element));
public static String getConnectorName(String beanClassName) { final String[] splits = StringUtils.split(beanClassName, "."); return splits[splits.length-2]; }
/** * Chop i characters off the end of a string. * This method assumes that any EOL characters in String s * and the platform EOL will be the same. * A 2 character EOL will count as 1 character. * * @param s String to chop. * @param i Number of characters to chop. * @return String with processed answer. */ public static String chop(String s, int i) { return chop(s, i, EOL); }
name = StringUtils.normalizePath(name); if (name == null || name.length() == 0)
/** * Trim all strings in a List. Changes the strings in the existing list. * @param list * @return List of trimmed strings. * @since 1.5 */ public static List trimStrings(List list) { if (list == null) return null; int sz = list.size(); for (int i = 0; i < sz; i++) list.set(i,nullTrim((String) list.get(i))); return list; }
"Look at your properties file and make sure the\n" + "name of the template loader is correct. Here is the\n" + "error: " + StringUtils.stackTrace(e)); "\nError is: " + StringUtils.stackTrace(e));
String value = StringUtils.nullTrim(contextProperties.getString(property)); value = StringUtils.fileContentsToString( project.resolveFile(value).getCanonicalPath());
/** * Returns whether the processed template matches the * content of the provided comparison file. * * @return Whether the output matches the contents * of the comparison file. * * @exception Exception Test failure condition. */ protected boolean isMatch (String resultsDir, String compareDir, String baseFileName, String resultExt, String compareExt) throws Exception { String result = StringUtils.fileContentsToString (getFileName(resultsDir, baseFileName, resultExt)); String compare = StringUtils.fileContentsToString (getFileName(compareDir, baseFileName, compareExt)); /* * normalize each wrt newline */ return normalizeNewlines(result).equals( normalizeNewlines( compare ) ); }
/** * @param argStr * @param vars * @return Substituted String. */ public static StringBuffer stringSubstitution( String argStr, Hashtable vars ) { return stringSubstitution( argStr, (Map) vars ); }
/** * <p> * 'Camels Hump' replacement of underscores. * </p> * * <p> * Remove underscores from a string but leave the capitalization of the * other letters unchanged. * </p> * * <p> * For example <code>foo_barBar</code> becomes <code>FooBarBar</code>. * </p> * * @param data string to hump * @return String */ static public String removeAndHump (String data) { return removeAndHump(data,"_"); }
/** * <p> * Remove underscores from a string and replaces first * letters with capitals. Other letters are changed to lower case. * </p> * * <p> * For example <code>foo_bar</code> becomes <code>FooBar</code> * but <code>foo_barBar</code> becomes <code>FooBarbar</code>. * </p> * * @param data string to remove underscores from. * @return String * @deprecated Use the org.apache.commons.util.StringUtils class * instead. Using its firstLetterCaps() method in conjunction * with a StringTokenizer will achieve the same result. */ static public String removeUnderScores (String data) { String temp = null; StringBuffer out = new StringBuffer(); temp = data; StringTokenizer st = new StringTokenizer(temp, "_"); while (st.hasMoreTokens()) { String element = (String) st.nextElement(); out.append ( firstLetterCaps(element)); } return out.toString(); }
name = StringUtils.normalizePath(name); if (name == null || name.length() == 0)
/** * Trim all strings in a List. Changes the strings in the existing list. * @param list * @return List of trimmed strings. * @since 1.5 */ public static List trimStrings(List list) { if (list == null) return null; int sz = list.size(); for (int i = 0; i < sz; i++) list.set(i,nullTrim((String) list.get(i))); return list; }
/** * First passes off the message at the specified level, * then passes off stack trace of the Throwable as a * 2nd message at the same level. * @param level * @param message * @param t */ public void log(int level, String message, Throwable t) { logSystem.logVelocityMessage(level, message); logSystem.logVelocityMessage(level, StringUtils.stackTrace(t)); }
String value = StringUtils.nullTrim(contextProperties.getString(property)); value = StringUtils.fileContentsToString( project.resolveFile(value).getCanonicalPath());
String contents = StringUtils.fileContentsToString(template);
public static StringBuffer stringSubstitution( String argStr, Hashtable vars ) { return stringSubstitution( argStr, (Map) vars ); }
/** * <p> * 'Camels Hump' replacement of underscores. * </p> * * <p> * Remove underscores from a string but leave the capitalization of the * other letters unchanged. * </p> * * <p> * For example <code>foo_barBar</code> becomes <code>FooBarBar</code>. * </p> * * @param data string to hump * @return String */ static public String removeAndHump (String data) { return removeAndHump(data,"_"); }