// The scheme
if ( ( ( pos = Strings.areEquals( chars, 0, LDAP_SCHEME ) ) == StringConstants.NOT_EQUAL )
&& ( ( pos = Strings.areEquals( chars, 0, LDAPS_SCHEME ) ) == StringConstants.NOT_EQUAL ) )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04398 ) );
}
else
{
scheme = new String( chars, 0, pos );
}
// The hostport
if ( ( pos = parseHostPort( chars, pos ) ) == -1 )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04399 ) );
}
if ( pos == chars.length )
{
return;
}
// An optional '/'
if ( !Chars.isCharASCII( chars, pos, '/' ) )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04400, pos, chars[pos] ) );
}
pos++;
if ( pos == chars.length )
{
return;
}
// An optional Dn
if ( ( pos = parseDN( chars, pos ) ) == -1 )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04401 ) );
}
if ( pos == chars.length )
{
return;
}
// Optionals attributes
if ( !Chars.isCharASCII( chars, pos, '?' ) )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
}
pos++;
if ( ( pos = parseAttributes( chars, pos ) ) == -1 )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04403 ) );
}
if ( pos == chars.length )
{
return;
}
// Optional scope
if ( !Chars.isCharASCII( chars, pos, '?' ) )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
}
pos++;
if ( ( pos = parseScope( chars, pos ) ) == -1 )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04404 ) );
}
if ( pos == chars.length )
{
return;
}
// Optional filter
if ( !Chars.isCharASCII( chars, pos, '?' ) )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
}
pos++;
if ( pos == chars.length )
{
return;
}
if ( ( pos = parseFilter( chars, pos ) ) == -1 )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04405 ) );
}
if ( pos == chars.length )
{
return;
}
// Optional extensions
if ( !Chars.isCharASCII( chars, pos, '?' ) )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04402, pos, chars[pos] ) );
}
pos++;
if ( ( pos = parseExtensions( chars, pos ) ) == -1 )
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04406 ) );
}
if ( pos == chars.length )
{
return;
}
else
{
throw new LdapURLEncodingException( I18n.err( I18n.ERR_04407 ) );
}
}