> + @Override
> + public void validate(String vaultName) {
> + if (vaultName == null || vaultName.length() < MIN_LENGTH ||
> vaultName.length() > MAX_LENGTH)
> + throw exception(vaultName, "Can't be null or empty. Length must be
> " + MIN_LENGTH + " to " + MAX_LENGTH
> + + " symbols.");
> + CharMatcher range = getAcceptableRange();
> + if (!range.matchesAllOf(vaultName))
> + throw exception(vaultName, "Should have ASCII letters and numbers,
> underscores, hyphens, or periods.");
> + }
> +
> + private static CharMatcher getAcceptableRange() {
> + return CharMatcher.inRange('a', 'z').or(CharMatcher.inRange('A',
> 'Z')).or(CharMatcher.inRange('0', '9'))
> + .or(CharMatcher.anyOf("-_."));
> + }
> +
> + protected IllegalArgumentException exception(String vaultName, String
> reason) {
`protected static`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/4/files#r13034802