List of utility methods to do String Blur
String | blur(String s) replaces everything but the first and last letter of the input string s by '.' if (!BLUR) return s; if (s == null || s.length() <= 1) return s; char c[] = s.toCharArray(); for (int i = 1; i < s.length() - 1; i++) c[i] = '.'; return new String(c); ... |
String | blurKeepingExtension(String s) blurs a filename but keeps the extension intact. if (s == null) return null; int idx = s.lastIndexOf("."); if (idx <= 0) return blur(s); int MAX_EXTENSION_LENGTH = 6; if (s.length() - idx > MAX_EXTENSION_LENGTH) return blur(s); ... |