The HTTP URL.
HttpURL
protected HttpURL()
Create an instance as an internal use.
HttpURL
public HttpURL(String original,
String charset)
throws URIException
Construct a HTTP URL from a given string with the given charset to do
escape encoding.
original
- the HTTP URL stringcharset
- the charset string to do escape encoding
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String user,
String password,
String host)
throws URIException
Construct a HTTP URL from given components.
user
- the user namepassword
- his or her passwordhost
- the host string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String host,
String path,
String query,
String fragment)
throws URIException
Construct a HTTP URL from given components.
host
- the host stringpath
- the path stringquery
- the query stringfragment
- the fragment string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String userinfo,
String host,
String path,
String query,
String fragment)
throws URIException
Construct a HTTP URL from given components.
Note: The userinfo
format is normally
<username>:<password>
where
username and password must both be URL escaped.
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringpath
- the path stringquery
- the query stringfragment
- the fragment string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String user,
String password,
String host,
int port)
throws URIException
Construct a HTTP URL from given components.
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port number
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String user,
String password,
String host,
int port,
String path)
throws URIException
Construct a HTTP URL from given components.
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port numberpath
- the path string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String user,
String password,
String host,
int port,
String path,
String query)
throws URIException
Construct a HTTP URL from given components.
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port numberpath
- the path stringquery
- The query string.
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String user,
String password,
String host,
int port,
String path,
String query,
String fragment)
throws URIException
Construct a HTTP URL from given components.
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port numberpath
- the path stringquery
- the query stringfragment
- the fragment string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String userinfo,
String host,
int port,
String path)
throws URIException
Construct a HTTP URL from given components.
Note: The userinfo
format is normally
<username>:<password>
where
username and password must both be URL escaped.
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringport
- the port numberpath
- the path string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String userinfo,
String host,
int port,
String path,
String query)
throws URIException
Construct a HTTP URL from given components.
Note: The userinfo
format is normally
<username>:<password>
where
username and password must both be URL escaped.
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringport
- the port numberpath
- the path stringquery
- the query string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String userinfo,
String host,
int port,
String path,
String query,
String fragment)
throws URIException
Construct a HTTP URL from given components.
Note: The userinfo
format is normally
<username>:<password>
where
username and password must both be URL escaped.
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringport
- the port numberpath
- the path stringquery
- the query stringfragment
- the fragment string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String host,
int port,
String path)
throws URIException
Construct a HTTP URL from given components.
host
- the host stringport
- the port numberpath
- the path string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(String host,
int port,
String path,
String query)
throws URIException
Construct a HTTP URL from given components.
host
- the host stringport
- the port numberpath
- the path stringquery
- the query string
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(char[] escaped)
throws URIException,
NullPointerException
Construct a HTTP URL as an escaped form of a character array.
escaped
- the HTTP URL character sequence
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(char[] escaped,
String charset)
throws URIException,
NullPointerException
Construct a HTTP URL as an escaped form of a character array with the
given charset to do escape encoding.
escaped
- the HTTP URL character sequencecharset
- the charset string to do escape encoding
URIException
- If checkValid()
fails
HttpURL
HttpURL
public HttpURL(HttpURL base,
String relative)
throws URIException
Construct a HTTP URL with a given relative URL string.
base
- the base HttpURLrelative
- the relative HTTP URL string
URIException
- If checkValid()
fails
checkValid
protected void checkValid()
throws URIException
Verify the valid class use for construction.
URIException
- the wrong scheme use
getEscapedPassword
public String getEscapedPassword()
Get the escaped password.
- the escaped password
getEscapedUser
public String getEscapedUser()
Get the escaped user
- the escaped user
getPort
public int getPort()
Get the port number.
- getPort in interface URI
- the port number
getRawPassword
public char[] getRawPassword()
Get the raw-escaped password.
- the raw-escaped password
getRawPath
public char[] getRawPath()
Get the raw escaped path.
- getRawPath in interface URI
- the path '/' if empty or undefined
getRawScheme
public char[] getRawScheme()
Get the scheme. You can get the scheme explicitly.
- getRawScheme in interface URI
- the scheme
getRawUser
public char[] getRawUser()
Get the raw-escaped user.
- the raw-escaped user
getScheme
public String getScheme()
Get the scheme. You can get the scheme explicitly.
- getScheme in interface URI
- the scheme null if empty or undefined
setEscapedPassword
public void setEscapedPassword(String escapedPassword)
throws URIException
Set the escaped password string.
escapedPassword
- the escaped password string; could be null
URIException
- escaped password not valid or username missed
setEscapedUser
public void setEscapedUser(String escapedUser)
throws URIException,
NullPointerException
Set the escaped user string.
escapedUser
- the escaped user string
URIException
- escaped user not valid
setEscapedUserinfo
public void setEscapedUserinfo(String escapedUser,
String escapedPassword)
throws URIException,
NullPointerException
Set the raw-escaped user and password.
escapedUser
- the escaped userescapedPassword
- the escaped password; could be null
URIException
- escaped user not valid or user required; escaped
password not valid or username missed
setPassword
public void setPassword(String password)
throws URIException
Set the password string.
password
- the password string; could be null
URIException
- encoding error or username missed
setQuery
public void setQuery(String queryName,
String queryValue)
throws URIException,
NullPointerException
Set the query as the name and value pair.
queryName
- the query string.queryValue
- the query string.
URIException
- incomplete trailing escape pattern
Or unsupported character encoding
HttpURL
setQuery
public void setQuery(String[] queryName,
String[] queryValue)
throws URIException,
NullPointerException
Set the query as the name and value pairs.
queryName
- the array of the query string.queryValue
- the array of the query string.
URIException
- incomplete trailing escape pattern,
unsupported character encoding or wrong array size
HttpURL
setRawPassword
public void setRawPassword(char[] escapedPassword)
throws URIException
Set the raw-escaped password.
escapedPassword
- the raw-escaped password; could be null
URIException
- escaped password not valid or username missed
setRawUser
public void setRawUser(char[] escapedUser)
throws URIException
Set the raw-escaped user.
escapedUser
- the raw-escaped user
URIException
- escaped user not valid or user required
setRawUserinfo
public void setRawUserinfo(char[] escapedUser,
char[] escapedPassword)
throws URIException
Set the raw-escaped user and password.
escapedUser
- the raw-escaped userescapedPassword
- the raw-escaped password; could be null
URIException
- escaped user not valid or user required; escaped
password not valid or username missed
setUser
public void setUser(String user)
throws URIException,
NullPointerException
Set the user string.
user
- the user string
URIException
- user encoding error
setUserinfo
public void setUserinfo(String user,
String password)
throws URIException,
NullPointerException
Set the user and password.
user
- the userpassword
- the password; could be null
URIException
- encoding error or username missed
toUserinfo
protected static String toUserinfo(String user,
String password)
throws URIException