|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.codec.util.LdapURL
public class LdapURL
Decodes a LdapUrl, and checks that it complies with the RFC 2255. The grammar is the following : ldapurl = scheme "://" [hostport] ["/" [dn ["?" [attributes] ["?" [scope] ["?" [filter] ["?" extensions]]]]]] scheme = "ldap" attributes = attrdesc *("," attrdesc) scope = "base" / "one" / "sub" dn = LdapDN hostport = hostport from Section 5 of RFC 1738 attrdesc = AttributeDescription from Section 4.1.5 of RFC 2251 filter = filter from Section 4 of RFC 2254 extensions = extension *("," extension) extension = ["!"] extype ["=" exvalue] extype = token / xtoken exvalue = LDAPString token = oid from section 4.1 of RFC 2252 xtoken = ("X-" / "x-") token
Field Summary | |
---|---|
static LdapURL |
EMPTY_URL
A null LdapURL |
Constructor Summary | |
---|---|
LdapURL()
Construct an empty LdapURL |
|
LdapURL(byte[] bytes)
Create a new LdapURL after having parsed it. |
|
LdapURL(java.lang.String string)
Create a new LdapURL from a String after having parsed it. |
Method Summary | |
---|---|
static byte[] |
getAsciiBytes(java.lang.String data)
Converts the specified string to byte array of ASCII characters. |
java.util.ArrayList |
getAttributes()
|
byte[] |
getBytes()
|
java.util.HashMap |
getCriticalExtensions()
|
LdapDN |
getDn()
|
java.util.HashMap |
getExtensions()
|
java.lang.String |
getFilter()
|
java.lang.String |
getHost()
|
int |
getNbBytes()
|
int |
getPort()
|
java.lang.String |
getScheme()
|
int |
getScope()
|
java.lang.String |
getString()
|
static java.lang.String |
getString(byte[] data,
int offset,
int length,
java.lang.String charset)
From commons-httpclients. |
static java.lang.String |
getString(byte[] data,
java.lang.String charset)
From commons-httpclients. |
void |
parse(char[] chars)
Parse a LdapURL |
java.lang.String |
toString()
Get a string representation of a LdapURL. |
static java.lang.String |
urlEncode(java.lang.String string,
boolean doubleEncode)
Encode a String to avoid special characters *NOTE* : this is an ugly function, just needed because the RFC 2255 is VERY unclear about the way LDAP searches are to be encoded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final transient LdapURL EMPTY_URL
Constructor Detail |
---|
public LdapURL()
public LdapURL(java.lang.String string) throws LdapURLEncodingException
string
- TheString that contains the LDAPURL
LdapURLEncodingException
- If the String does not comply with RFC 2255public LdapURL(byte[] bytes) throws LdapURLEncodingException
bytes
- The byte buffer that contains the LDAPURL
LdapURLEncodingException
- If the byte array does not comply with RFC 2255Method Detail |
---|
public void parse(char[] chars) throws LdapURLEncodingException
chars
- The chars containing the URL
LdapURLEncodingException
- If the URL is invalidpublic static java.lang.String getString(byte[] data, int offset, int length, java.lang.String charset)
data
- the byte array to be encodedoffset
- the index of the first byte to encodelength
- the number of bytes to encodecharset
- the desired character encoding
public static java.lang.String getString(byte[] data, java.lang.String charset)
data
- the byte array to be encodedcharset
- the desired character encoding
public static byte[] getAsciiBytes(java.lang.String data)
data
- the string to be encoded
public static java.lang.String urlEncode(java.lang.String string, boolean doubleEncode)
string
- The String to encodedoubleEncode
- Set if we need to encode the comma
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.ArrayList getAttributes()
public java.util.HashMap getCriticalExtensions()
public LdapDN getDn()
public java.util.HashMap getExtensions()
public java.lang.String getFilter()
public java.lang.String getHost()
public int getPort()
public int getScope()
public java.lang.String getScheme()
public int getNbBytes()
public byte[] getBytes()
public java.lang.String getString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |