/** * Parse the following rule : * <pre> * oid ::= numericOid | descr * descr ::= keystring * keystring ::= leadkeychar *keychar * leadkeychar ::= [a-zA-Z] * keychar ::= [a-zA-Z0-0-] * numericOid ::= number 1*( DOT number ) * number ::= 0 | [1-9][0-9]* * </pre> * * @param attribute The attribute to validate * @throws LdapURLEncodingException If teh attribute is invalid */ private void validateAttribute( String attribute ) throws LdapURLEncodingException { Matcher matcher = ATTRIBUTE.matcher( attribute ); if ( !matcher.matches() ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13011_ATTRIBUTE_INVALID, attribute ) ); } }
/** * Parse the following rule : * <pre> * oid ::= numericOid | descr * descr ::= keystring * keystring ::= leadkeychar *keychar * leadkeychar ::= [a-zA-Z] * keychar ::= [a-zA-Z0-0-] * numericOid ::= number 1*( DOT number ) * number ::= 0 | [1-9][0-9]* * </pre> * * @param attribute The attribute to validate * @throws LdapURLEncodingException If teh attribute is invalid */ private void validateAttribute( String attribute ) throws LdapURLEncodingException { Matcher matcher = ATTRIBUTE.matcher( attribute ); if ( !matcher.matches() ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13011_ATTRIBUTE_INVALID, attribute ) ); } }
/** * Parse the following rule : * <pre> * oid ::= numericOid | descr * descr ::= keystring * keystring ::= leadkeychar *keychar * leadkeychar ::= [a-zA-Z] * keychar ::= [a-zA-Z0-0-] * numericOid ::= number 1*( DOT number ) * number ::= 0 | [1-9][0-9]* * </pre> * * @param attribute The attribute to validate * @throws LdapURLEncodingException If teh attribute is invalid */ private void validateAttribute( String attribute ) throws LdapURLEncodingException { Matcher matcher = ATTRIBUTE.matcher( attribute ); if ( !matcher.matches() ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13011_ATTRIBUTE_INVALID, attribute ) ); } }
/** * Create a new LdapUrl from a String after having parsed it. * * @param string TheString that contains the LdapUrl * @throws LdapURLEncodingException If the String does not comply with RFC 2255 */ public LdapUrl( String string ) throws LdapURLEncodingException { if ( string == null ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13041_INVALID_LDAP_URL_EMPTY_STRING ) ); } bytes = Strings.getBytesUtf8( string ); this.string = string; parse( string.toCharArray() ); }
/** * Create a new LdapUrl from a String after having parsed it. * * @param string TheString that contains the LdapUrl * @throws LdapURLEncodingException If the String does not comply with RFC 2255 */ public LdapUrl( String string ) throws LdapURLEncodingException { if ( string == null ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13041_INVALID_LDAP_URL_EMPTY_STRING ) ); } bytes = Strings.getBytesUtf8( string ); this.string = string; parse( string.toCharArray() ); }
/** * Create a new LdapUrl from a String after having parsed it. * * @param string TheString that contains the LdapUrl * @throws LdapURLEncodingException If the String does not comply with RFC 2255 */ public LdapUrl( String string ) throws LdapURLEncodingException { if ( string == null ) { throw new LdapURLEncodingException( I18n.err( I18n.ERR_13041_INVALID_LDAP_URL_EMPTY_STRING ) ); } bytes = Strings.getBytesUtf8( string ); this.string = string; parse( string.toCharArray() ); }
if ( pos == StringConstants.NOT_EQUAL ) throw new LdapURLEncodingException( I18n.err( I18n.ERR_13030_LDAP_URL_MUST_START_WITH_LDAP ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13031_INVALID_HOST_PORT ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13032_SLASH_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13033_INVALID_DN ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13035_INVALID_ATTRIBUTES ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13036_INVALID_SCOPE ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13037_INVALID_FILTER ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13038_INVALID_EXTENSIONS ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13039_INVALID_CHAR_AT_LDAP_URL_END ) );
if ( pos == StringConstants.NOT_EQUAL ) throw new LdapURLEncodingException( I18n.err( I18n.ERR_13030_LDAP_URL_MUST_START_WITH_LDAP ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13031_INVALID_HOST_PORT ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13032_SLASH_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13033_INVALID_DN ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13035_INVALID_ATTRIBUTES ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13036_INVALID_SCOPE ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13037_INVALID_FILTER ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13038_INVALID_EXTENSIONS ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13039_INVALID_CHAR_AT_LDAP_URL_END ) );
if ( pos == StringConstants.NOT_EQUAL ) throw new LdapURLEncodingException( I18n.err( I18n.ERR_13030_LDAP_URL_MUST_START_WITH_LDAP ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13031_INVALID_HOST_PORT ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13032_SLASH_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13033_INVALID_DN ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13035_INVALID_ATTRIBUTES ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13036_INVALID_SCOPE ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13037_INVALID_FILTER ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13034_QUESTION_MARK_EXPECTED, pos, chars[pos] ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13038_INVALID_EXTENSIONS ) ); throw new LdapURLEncodingException( I18n.err( I18n.ERR_13039_INVALID_CHAR_AT_LDAP_URL_END ) );