private void validateFilter(String value) { // check for invalid characters if (Log.hasIllegalCharacters(value)) { //Error for filter '{filter}'. The following characters are not valid: {Log.INVALID_CHARS} LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_FILTER_CHARS, new Object[]{value, Log.INVALID_CHARS}); throw ex; } int index = value.indexOf('*'); if ((index >= 0) && (index != (value.length() - 1))) { //Error for filter '{filter}'. '*' must be the right most character. LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_FILTER_STAR, new Object[]{value}); throw ex; } } }
private void validateFilter(String value) { // check for invalid characters if (Log.hasIllegalCharacters(value)) { //Error for filter '{filter}'. The following characters are not valid: {Log.INVALID_CHARS} LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_FILTER_CHARS, new Object[]{value, Log.INVALID_CHARS}); throw ex; } int index = value.indexOf("*"); if ((index >= 0) && (index != (value.length() - 1))) { //Error for filter '{filter}'. '*' must be the right most character. LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_FILTER_STAR, new Object[]{value}); throw ex; } } }
private void validateFilter(String value) { // check for invalid characters if (Log.hasIllegalCharacters(value)) { //Error for filter '{filter}'. The following characters are not valid: {Log.INVALID_CHARS} LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_FILTER_CHARS, new Object[]{value, Log.INVALID_CHARS}); throw ex; } int index = value.indexOf('*'); if ((index >= 0) && (index != (value.length() - 1))) { //Error for filter '{filter}'. '*' must be the right most character. LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_FILTER_STAR, new Object[]{value}); throw ex; } } }
/** * This method will ensure that a valid category string has been specified. * If the category is not valid an exception will be thrown. * * Categories can not contain any blanks or any of the following characters: * []`*~,!#$%^&()]{}+=\|'";?><./@ or be less than 1 character in length. */ private static void checkCategory(String category) { if (category == null || category.length() == 0) { // Categories must be at least one character in length. LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_CATEGORY); throw ex; } if (hasIllegalCharacters(category) || (category.indexOf("*") != -1)) { // Categories can not contain any of the following characters: 'INVALID_CHARS' LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_CATEGORY_CHARS, new Object[]{INVALID_CHARS}); throw ex; } }
/** * This method will ensure that a valid category string has been specified. * If the category is not valid an exception will be thrown. * * Categories can not contain any blanks or any of the following characters: * []`*~,!#$%^&()]{}+=\|'";?><./&#64; or be less than 1 character in length. */ private static void checkCategory(String category) { if (category == null || category.length() == 0) { // Categories must be at least one character in length. LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_CATEGORY); throw ex; } if (hasIllegalCharacters(category) || (category.indexOf("*") != -1)) { // Categories can not contain any of the following characters: 'INVALID_CHARS' LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_CATEGORY_CHARS, new Object[]{INVALID_CHARS}); throw ex; } }
/** * This method will ensure that a valid category string has been specified. * If the category is not valid an exception will be thrown. * * Categories can not contain any blanks or any of the following characters: * []`*~,!#$%^&()]{}+=\|'";?><./&#64; or be less than 1 character in length. */ private static void checkCategory(String category) { if (category == null || category.length() == 0) { // Categories must be at least one character in length. LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_CATEGORY); throw ex; } if (hasIllegalCharacters(category) || (category.indexOf("*") != -1)) { // Categories can not contain any of the following characters: 'INVALID_CHARS' LocalizedException ex = new LocalizedException(); ex.setMessage(INVALID_CATEGORY_CHARS, new Object[]{INVALID_CHARS}); throw ex; } }