StringUtil { public static boolean isSafeString(String string0) { for (int i = 0; i < string0.length(); i++) { if (!isSafeChar(string0.charAt(i))) { return false; } } return true; }  static String substituteWithEnvironment(String string0); static String substituteWithProperties(String string0, String startStr, String endStr, Properties properties); static boolean isSafeString(String string0); static boolean isSafeChar(char ch); static String capitalize(String string0); static String uncapitalize(String string0); static boolean contains(String[] strings, String targetString); static int indexOf(String[] strings, String targetString); static String stripQuotes(String string0); static boolean containsOnlyDigits(String string0); static String[] split(String str, char delim); final static String formatForPrint(String input); static String[] toStringArray(Object[] objArray); static byte[] getAsciiBytes(String input); static String getAsciiString(byte[] input); static String trimTrailing(String str); static String truncate(String value, int length); static String slice(String value,
            int beginOffset, int endOffset,
            boolean trim); @Deprecated static String toHexString(byte[] bytes); @Deprecated static String toHexString(byte[] bytes, int offset, int length); @Deprecated static byte[] toHexByte(String hexString, int offset, int length); @Deprecated static byte[] fromHexString(String hexString); @Deprecated static byte[] fromHexString(String hexString, int offset, int length); static boolean isPrintableChar(char ch); static String hexDump(String prefix, byte[] data); static String SQLToUpperCase(String s); static boolean SQLEqualsIgnoreCase(String s1, String s2); static String normalizeSQLIdentifier(String id); static String compressQuotes(String source, String quotes); static String quoteStringLiteral(String string); static String stringify(int[] raw); static boolean isEmpty(String string0); static boolean isEqual(String string0, String string1); static String toStringWithNullAsEmpty(Object obj); static String toStringWithNullAsReplaced(Object obj); static String toStringWithNullAsNull(Object obj); static boolean isEqual(String string0, String string1, boolean caseSensitive); static String readToString(InputStream in); static String escapeXml(String value); static String removeAllCharsExceptDigits(String str0); static char[] HEX_TABLE; }
@Test public void isSafeString() { Assert.assertEquals(true, StringUtil.isSafeString("abcdefghijklmnopqrstuvwzwz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")); Assert.assertEquals(false, StringUtil.isSafeString(" ")); Assert.assertEquals(false, StringUtil.isSafeString("\n")); Assert.assertEquals(false, StringUtil.isSafeString("\t")); Assert.assertEquals(false, StringUtil.isSafeString("\r")); }