/** * Sets the charset to be applied to the salt for conversion into bytes. * * @param charset the specified charset */ public synchronized void setCharset(final String charset) { CommonUtils.validateNotNull(charset, "Charset cannot be set null"); this.charset = charset; }
static boolean getVerbosity(final String[] args) { for (int i = 0; i < args.length; i++) { final String key = CommonUtils.substringBefore(args[i], "="); final String value = CommonUtils.substringAfter(args[i], "="); if (CommonUtils.isEmpty(key) || CommonUtils.isEmpty(value)) { continue; } if (ArgumentNaming.ARG_VERBOSE.equals(key)) { final Boolean verbosity = CommonUtils.getStandardBooleanValue(value); return (verbosity != null? verbosity.booleanValue() : false); } } return true; }
public static String[] split(final String string) { // Whitespace will be used as separator return split(string, null); }
final String key = CommonUtils.substringBefore(args[i], "="); final String value = CommonUtils.substringAfter(args[i], "="); if (CommonUtils.isEmpty(key) || CommonUtils.isEmpty(value)) { throw new IllegalArgumentException("Bad argument: " + args[i]);
public static void validateNotEmpty(final String string, final String message) { if (isEmpty(string)) { throw new IllegalArgumentException(message); } }
/** * Set the config object to use the specified JVM system property to * load a value for the "unicode normalization ignored" parameter. * * @param unicodeNormalizationIgnoredSysPropertyName the name of the property */ public void setUnicodeNormalizationIgnoredSysPropertyName(final String unicodeNormalizationIgnoredSysPropertyName) { this.unicodeNormalizationIgnoredSysPropertyName = unicodeNormalizationIgnoredSysPropertyName; if (unicodeNormalizationIgnoredSysPropertyName == null) { this.unicodeNormalizationIgnored = null; } else { this.unicodeNormalizationIgnoredEnvName = null; final String unicodeNormalizationIgnoredValue = System.getProperty(unicodeNormalizationIgnoredSysPropertyName); if (unicodeNormalizationIgnoredValue != null) { this.unicodeNormalizationIgnored = CommonUtils.getStandardBooleanValue( unicodeNormalizationIgnoredValue); } else { this.unicodeNormalizationIgnored = null; } } }
/** * <p> * Returns whether this config object is complete or not (both name and * validation word have been set). <b>Intended for internal use only</b>. * </p> * * @return whether the config object is complete or not. */ public boolean isComplete() { return ((CommonUtils.isNotEmpty(this.name)) && (CommonUtils.isNotEmpty(this.validationWord))); }
/** * <p> * Sets the the form in which String output * will be encoded. Available encoding types are: * </p> * <ul> * <li><tt><b>base64</b></tt> (default)</li> * <li><tt><b>hexadecimal</b></tt></li> * </ul> * <p> * If not set, null will be returned. * </p> * * @param stringOutputType the string output type. */ public void setStringOutputType(final String stringOutputType) { this.stringOutputType = CommonUtils. getStandardStringOutputType(stringOutputType); }
return CommonUtils.appendArrays(salt, digest); return CommonUtils.appendArrays(digest, salt);
digestBytes = this.base64.decode(digestBytes); } else { digestBytes = CommonUtils.fromHexadecimal(processedDigest);
final String key = CommonUtils.substringBefore(args[i], "="); final String value = CommonUtils.substringAfter(args[i], "="); if (CommonUtils.isEmpty(key) || CommonUtils.isEmpty(value)) { throw new IllegalArgumentException("Bad argument: " + args[i]);
public static void validateNotEmpty(final String string, final String message) { if (isEmpty(string)) { throw new IllegalArgumentException(message); } }
public synchronized void setParameterValues(final Properties parameters) { super.setParameterValues(parameters); final String paramStoreTimeZone = parameters.getProperty(ParameterNaming.STORE_TIME_ZONE); if ((paramStoreTimeZone != null) && (!paramStoreTimeZone.trim().equals(""))) { this.storeTimeZone = CommonUtils.getStandardBooleanValue(paramStoreTimeZone); } }
/** * <p> * Returns whether this config object is complete or not (both name and * validation word have been set). <b>Intended for internal use only</b>. * </p> * * @return whether the config object is complete or not. */ public boolean isComplete() { return ((CommonUtils.isNotEmpty(this.name)) && (CommonUtils.isNotEmpty(this.validationWord))); }
/** * <p> * Sets the the form in which String output * will be encoded. Available encoding types are: * </p> * <ul> * <li><tt><b>base64</b></tt> (default)</li> * <li><tt><b>hexadecimal</b></tt></li> * </ul> * <p> * If not set, null will be returned. * </p> * * @param stringOutputType the string output type. */ public void setStringOutputType(final String stringOutputType) { this.stringOutputTypeEnvName = null; this.stringOutputTypeSysPropertyName = null; this.stringOutputType = CommonUtils. getStandardStringOutputType(stringOutputType); }
return CommonUtils.appendArrays(salt, digest); return CommonUtils.appendArrays(digest, salt);
digestBytes = this.base64.decode(digestBytes); } else { digestBytes = CommonUtils.fromHexadecimal(processedDigest);
static boolean getVerbosity(final String[] args) { for (int i = 0; i < args.length; i++) { final String key = CommonUtils.substringBefore(args[i], "="); final String value = CommonUtils.substringAfter(args[i], "="); if (CommonUtils.isEmpty(key) || CommonUtils.isEmpty(value)) { continue; } if (ArgumentNaming.ARG_VERBOSE.equals(key)) { final Boolean verbosity = CommonUtils.getStandardBooleanValue(value); return (verbosity != null? verbosity.booleanValue() : false); } } return true; }
/** * Sets the salt to be returned. * * @param salt the specified salt. */ public synchronized void setSalt(final String salt) { CommonUtils.validateNotNull(salt, "Salt cannot be set null"); this.salt = salt; }
final String key = CommonUtils.substringBefore(args[i], "="); final String value = CommonUtils.substringAfter(args[i], "="); if (CommonUtils.isEmpty(key) || CommonUtils.isEmpty(value)) { throw new IllegalArgumentException("Bad argument: " + args[i]);