List of utility methods to do String Sanitize
String | sanitizeUserEmail(String userEmail) Method sanitizeUserEmail cleans the userEmail from something like "john.ichat@rides.openfire/edbbeb61" to "john.ichat@rides.openfire" String sanitizedUserEmail = null; if (userEmail.contains("/")) { sanitizedUserEmail = userEmail.substring(0, userEmail.indexOf("/")); } else { sanitizedUserEmail = userEmail; return sanitizedUserEmail; |
String | sanitizeUserName(final String userName) sanitize User Name if (userName != null) { return userName.replace('.', ' '); return null; |
String | sanitizeVersion(String inVer) sanitize Version return inVer.replaceAll(" ", ""); |
String | sanitizeWebOutput(String text) sanitize Web Output text = text.replaceAll("<", "<"); return text; |
int | sanitizeYear(int yr) sanitize year using the rule of 60, two digit ears >=60 = 1900+yr years less than 60 are 2000+yr. if (yr >= 100) return yr; if (yr >= 60 && yr < 100) return yr + 1900; else if (yr < 60 && yr >= 0) return yr + 2000; System.out.println("Illegal year to sanitize =" + yr); return -1; ... |