public ExactIPAddressPermission()

in activeio-core/src/main/java/org/apache/activeio/xnet/hba/ExactIPAddressPermission.java [42:57]


    public ExactIPAddressPermission(String mask) {
        Matcher matcher = MASK_VALIDATOR.matcher(mask);
        if (false == matcher.matches()) {
            throw new IllegalArgumentException("Mask " + mask + " does not match pattern " + MASK_VALIDATOR.pattern());
        }

        bytes = new byte[4];
        for (int i = 0; i < 4; i++) {
            String group = matcher.group(i + 1);
            int value = Integer.parseInt(group);
            if (value < 0 || 255 < value) {
                throw new IllegalArgumentException("byte #" + i + " is not valid.");
            }
            bytes[i] = (byte) value;
        }
    }