Package org.apache.commons.httpclient
Class HttpURL
- java.lang.Object
-
- org.apache.commons.httpclient.URI
-
- org.apache.commons.httpclient.HttpURL
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
- Direct Known Subclasses:
HttpsURL
@Deprecated public class HttpURL extends URI
Deprecated.Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project. It is not recommended to use it in any new code. Instead, use HTTP client API plugins as a dependency in your code. E.g. Apache HttpComponents Client API 4.x Plugin or Async HTTP Client Plugin.The HTTP URL.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.commons.httpclient.URI
URI.DefaultCharsetChanged, URI.LocaleToCharsetMap
-
-
Field Summary
Fields Modifier and Type Field Description static int
_default_port
Deprecated.UseDEFAULT_PORT
instead.static char[]
_default_scheme
Deprecated.UseDEFAULT_SCHEME
instead.static int
DEFAULT_PORT
Deprecated.Default port for HTTP URL.static char[]
DEFAULT_SCHEME
Deprecated.Default scheme for HTTP URL.-
Fields inherited from class org.apache.commons.httpclient.URI
allowed_abs_path, allowed_authority, allowed_fragment, allowed_host, allowed_IPv6reference, allowed_opaque_part, allowed_query, allowed_reg_name, allowed_rel_path, allowed_userinfo, allowed_within_authority, allowed_within_path, allowed_within_query, allowed_within_userinfo, control, delims, disallowed_opaque_part, disallowed_rel_path, space, unwise, within_userinfo
-
-
Constructor Summary
Constructors Constructor Description HttpURL(char[] escaped)
Deprecated.Construct a HTTP URL as an escaped form of a character array.HttpURL(char[] escaped, java.lang.String charset)
Deprecated.Construct a HTTP URL as an escaped form of a character array with the given charset to do escape encoding.HttpURL(java.lang.String original)
Deprecated.Construct a HTTP URL from a given string.HttpURL(java.lang.String host, int port, java.lang.String path)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String host, int port, java.lang.String path, java.lang.String query)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String original, java.lang.String charset)
Deprecated.Construct a HTTP URL from a given string with the given charset to do escape encoding.HttpURL(java.lang.String userinfo, java.lang.String host, int port, java.lang.String path)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String userinfo, java.lang.String host, int port, java.lang.String path, java.lang.String query)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String userinfo, java.lang.String host, int port, java.lang.String path, java.lang.String query, java.lang.String fragment)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String user, java.lang.String password, java.lang.String host)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port, java.lang.String path)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port, java.lang.String path, java.lang.String query)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port, java.lang.String path, java.lang.String query, java.lang.String fragment)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String host, java.lang.String path, java.lang.String query, java.lang.String fragment)
Deprecated.Construct a HTTP URL from given components.HttpURL(java.lang.String userinfo, java.lang.String host, java.lang.String path, java.lang.String query, java.lang.String fragment)
Deprecated.Construct a HTTP URL from given components.HttpURL(HttpURL base, java.lang.String relative)
Deprecated.Construct a HTTP URL with a given relative URL string.HttpURL(HttpURL base, HttpURL relative)
Deprecated.Construct a HTTP URL with a given relative URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getEscapedPassword()
Deprecated.Get the escaped password.java.lang.String
getEscapedUser()
Deprecated.Get the escaped userjava.lang.String
getPassword()
Deprecated.Get the password.int
getPort()
Deprecated.Get the port number.char[]
getRawAboveHierPath()
Deprecated.Get the level above the this hierarchy level.char[]
getRawCurrentHierPath()
Deprecated.Get the raw-escaped current hierarchy level.char[]
getRawPassword()
Deprecated.Get the raw-escaped password.char[]
getRawPath()
Deprecated.Get the raw escaped path.char[]
getRawScheme()
Deprecated.Get the scheme.char[]
getRawUser()
Deprecated.Get the raw-escaped user.java.lang.String
getScheme()
Deprecated.Get the scheme.java.lang.String
getUser()
Deprecated.Get the user.void
setEscapedPassword(java.lang.String escapedPassword)
Deprecated.Set the escaped password string.void
setEscapedUser(java.lang.String escapedUser)
Deprecated.Set the escaped user string.void
setEscapedUserinfo(java.lang.String escapedUser, java.lang.String escapedPassword)
Deprecated.Set the raw-escaped user and password.void
setPassword(java.lang.String password)
Deprecated.Set the password string.void
setQuery(java.lang.String[] queryName, java.lang.String[] queryValue)
Deprecated.Set the query as the name and value pairs.void
setQuery(java.lang.String queryName, java.lang.String queryValue)
Deprecated.Set the query as the name and value pair.void
setRawPassword(char[] escapedPassword)
Deprecated.Set the raw-escaped password.void
setRawUser(char[] escapedUser)
Deprecated.Set the raw-escaped user.void
setRawUserinfo(char[] escapedUser, char[] escapedPassword)
Deprecated.Set the raw-escaped user and password.void
setUser(java.lang.String user)
Deprecated.Set the user string.void
setUserinfo(java.lang.String user, java.lang.String password)
Deprecated.Set the user and password.-
Methods inherited from class org.apache.commons.httpclient.URI
clone, compareTo, equals, getAboveHierPath, getAuthority, getCurrentHierPath, getDefaultDocumentCharset, getDefaultDocumentCharsetByLocale, getDefaultDocumentCharsetByPlatform, getDefaultProtocolCharset, getEscapedAboveHierPath, getEscapedAuthority, getEscapedCurrentHierPath, getEscapedFragment, getEscapedName, getEscapedPath, getEscapedPathQuery, getEscapedQuery, getEscapedURI, getEscapedURIReference, getEscapedUserinfo, getFragment, getHost, getName, getPath, getPathQuery, getProtocolCharset, getQuery, getRawAuthority, getRawFragment, getRawHost, getRawName, getRawPathQuery, getRawQuery, getRawURI, getRawURIReference, getRawUserinfo, getURI, getURIReference, getUserinfo, hasAuthority, hasFragment, hashCode, hasQuery, hasUserinfo, isAbsoluteURI, isAbsPath, isHierPart, isHostname, isIPv4address, isIPv6reference, isNetPath, isOpaquePart, isRegName, isRelativeURI, isRelPath, isServer, normalize, setDefaultDocumentCharset, setDefaultProtocolCharset, setEscapedAuthority, setEscapedFragment, setEscapedPath, setEscapedQuery, setFragment, setPath, setQuery, setRawAuthority, setRawFragment, setRawPath, setRawQuery, toString
-
-
-
-
Field Detail
-
DEFAULT_SCHEME
public static final char[] DEFAULT_SCHEME
Deprecated.Default scheme for HTTP URL.
-
_default_scheme
public static final char[] _default_scheme
Deprecated.UseDEFAULT_SCHEME
instead. This one doesn't conform to the project naming conventions.Default scheme for HTTP URL.
-
DEFAULT_PORT
public static final int DEFAULT_PORT
Deprecated.Default port for HTTP URL.- See Also:
- Constant Field Values
-
_default_port
public static final int _default_port
Deprecated.UseDEFAULT_PORT
instead. This one doesn't conform to the project naming conventions.Default port for HTTP URL.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpURL
public HttpURL(char[] escaped, java.lang.String charset) throws URIException, java.lang.NullPointerException
Deprecated.Construct a HTTP URL as an escaped form of a character array with the given charset to do escape encoding.- Parameters:
escaped
- the HTTP URL character sequencecharset
- the charset string to do escape encoding- Throws:
URIException
- IfcheckValid()
failsjava.lang.NullPointerException
- ifescaped
isnull
- See Also:
URI.getProtocolCharset()
-
HttpURL
public HttpURL(char[] escaped) throws URIException, java.lang.NullPointerException
Deprecated.Construct a HTTP URL as an escaped form of a character array.- Parameters:
escaped
- the HTTP URL character sequence- Throws:
URIException
- IfcheckValid()
failsjava.lang.NullPointerException
- ifescaped
isnull
- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String original, java.lang.String charset) throws URIException
Deprecated.Construct a HTTP URL from a given string with the given charset to do escape encoding.- Parameters:
original
- the HTTP URL stringcharset
- the charset string to do escape encoding- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String original) throws URIException
Deprecated.Construct a HTTP URL from a given string.- Parameters:
original
- the HTTP URL string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String host, int port, java.lang.String path) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
host
- the host stringport
- the port numberpath
- the path string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String host, int port, java.lang.String path, java.lang.String query) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
host
- the host stringport
- the port numberpath
- the path stringquery
- the query string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String user, java.lang.String password, java.lang.String host) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
user
- the user namepassword
- his or her passwordhost
- the host string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port number- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port, java.lang.String path) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port numberpath
- the path string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port, java.lang.String path, java.lang.String query) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port numberpath
- the path stringquery
- The query string.- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String host, java.lang.String path, java.lang.String query, java.lang.String fragment) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
host
- the host stringpath
- the path stringquery
- the query stringfragment
- the fragment string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String userinfo, java.lang.String host, java.lang.String path, java.lang.String query, java.lang.String fragment) throws URIException
Deprecated.Construct a HTTP URL from given components. Note: Theuserinfo
format is normally<username>:<password>
where username and password must both be URL escaped.- Parameters:
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringpath
- the path stringquery
- the query stringfragment
- the fragment string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String userinfo, java.lang.String host, int port, java.lang.String path) throws URIException
Deprecated.Construct a HTTP URL from given components. Note: Theuserinfo
format is normally<username>:<password>
where username and password must both be URL escaped.- Parameters:
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringport
- the port numberpath
- the path string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String userinfo, java.lang.String host, int port, java.lang.String path, java.lang.String query) throws URIException
Deprecated.Construct a HTTP URL from given components. Note: Theuserinfo
format is normally<username>:<password>
where username and password must both be URL escaped.- Parameters:
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringport
- the port numberpath
- the path stringquery
- the query string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String userinfo, java.lang.String host, int port, java.lang.String path, java.lang.String query, java.lang.String fragment) throws URIException
Deprecated.Construct a HTTP URL from given components. Note: Theuserinfo
format is normally<username>:<password>
where username and password must both be URL escaped.- Parameters:
userinfo
- the userinfo string whose parts are URL escapedhost
- the host stringport
- the port numberpath
- the path stringquery
- the query stringfragment
- the fragment string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(java.lang.String user, java.lang.String password, java.lang.String host, int port, java.lang.String path, java.lang.String query, java.lang.String fragment) throws URIException
Deprecated.Construct a HTTP URL from given components.- Parameters:
user
- the user namepassword
- his or her passwordhost
- the host stringport
- the port numberpath
- the path stringquery
- the query stringfragment
- the fragment string- Throws:
URIException
- IfcheckValid()
fails- See Also:
URI.getDefaultProtocolCharset()
-
HttpURL
public HttpURL(HttpURL base, java.lang.String relative) throws URIException
Deprecated.Construct a HTTP URL with a given relative URL string.- Parameters:
base
- the base HttpURLrelative
- the relative HTTP URL string- Throws:
URIException
- IfcheckValid()
fails
-
HttpURL
public HttpURL(HttpURL base, HttpURL relative) throws URIException
Deprecated.Construct a HTTP URL with a given relative URL.- Parameters:
base
- the base HttpURLrelative
- the relative HttpURL- Throws:
URIException
- IfcheckValid()
fails
-
-
Method Detail
-
getRawScheme
public char[] getRawScheme()
Deprecated.Get the scheme. You can get the scheme explicitly.- Overrides:
getRawScheme
in classURI
- Returns:
- the scheme
-
getScheme
public java.lang.String getScheme()
Deprecated.Get the scheme. You can get the scheme explicitly.
-
getPort
public int getPort()
Deprecated.Get the port number.
-
setRawUserinfo
public void setRawUserinfo(char[] escapedUser, char[] escapedPassword) throws URIException
Deprecated.Set the raw-escaped user and password.- Parameters:
escapedUser
- the raw-escaped userescapedPassword
- the raw-escaped password; could be null- Throws:
URIException
- escaped user not valid or user required; escaped password not valid or username missed
-
setEscapedUserinfo
public void setEscapedUserinfo(java.lang.String escapedUser, java.lang.String escapedPassword) throws URIException, java.lang.NullPointerException
Deprecated.Set the raw-escaped user and password.- Parameters:
escapedUser
- the escaped userescapedPassword
- the escaped password; could be null- Throws:
URIException
- escaped user not valid or user required; escaped password not valid or username missedjava.lang.NullPointerException
- null user
-
setUserinfo
public void setUserinfo(java.lang.String user, java.lang.String password) throws URIException, java.lang.NullPointerException
Deprecated.Set the user and password.- Parameters:
user
- the userpassword
- the password; could be null- Throws:
URIException
- encoding error or username missedjava.lang.NullPointerException
- null user
-
setRawUser
public void setRawUser(char[] escapedUser) throws URIException
Deprecated.Set the raw-escaped user.- Parameters:
escapedUser
- the raw-escaped user- Throws:
URIException
- escaped user not valid or user required
-
setEscapedUser
public void setEscapedUser(java.lang.String escapedUser) throws URIException, java.lang.NullPointerException
Deprecated.Set the escaped user string.- Parameters:
escapedUser
- the escaped user string- Throws:
URIException
- escaped user not validjava.lang.NullPointerException
- null user
-
setUser
public void setUser(java.lang.String user) throws URIException, java.lang.NullPointerException
Deprecated.Set the user string.- Parameters:
user
- the user string- Throws:
URIException
- user encoding errorjava.lang.NullPointerException
- null user
-
getRawUser
public char[] getRawUser()
Deprecated.Get the raw-escaped user.- Returns:
- the raw-escaped user
-
getEscapedUser
public java.lang.String getEscapedUser()
Deprecated.Get the escaped user- Returns:
- the escaped user
-
getUser
public java.lang.String getUser() throws URIException
Deprecated.Get the user.- Returns:
- the user name
- Throws:
URIException
- IfURI.decode(char[], java.lang.String)
fails
-
setRawPassword
public void setRawPassword(char[] escapedPassword) throws URIException
Deprecated.Set the raw-escaped password.- Parameters:
escapedPassword
- the raw-escaped password; could be null- Throws:
URIException
- escaped password not valid or username missed
-
setEscapedPassword
public void setEscapedPassword(java.lang.String escapedPassword) throws URIException
Deprecated.Set the escaped password string.- Parameters:
escapedPassword
- the escaped password string; could be null- Throws:
URIException
- escaped password not valid or username missed
-
setPassword
public void setPassword(java.lang.String password) throws URIException
Deprecated.Set the password string.- Parameters:
password
- the password string; could be null- Throws:
URIException
- encoding error or username missed
-
getRawPassword
public char[] getRawPassword()
Deprecated.Get the raw-escaped password.- Returns:
- the raw-escaped password
-
getEscapedPassword
public java.lang.String getEscapedPassword()
Deprecated.Get the escaped password.- Returns:
- the escaped password
-
getPassword
public java.lang.String getPassword() throws URIException
Deprecated.Get the password.- Returns:
- the password
- Throws:
URIException
- IfURI.decode(char[],String)
fails.
-
getRawCurrentHierPath
public char[] getRawCurrentHierPath() throws URIException
Deprecated.Get the raw-escaped current hierarchy level.- Overrides:
getRawCurrentHierPath
in classURI
- Returns:
- the raw-escaped current hierarchy level
- Throws:
URIException
- IfURI.getRawCurrentHierPath(char[])
fails.
-
getRawAboveHierPath
public char[] getRawAboveHierPath() throws URIException
Deprecated.Get the level above the this hierarchy level.- Overrides:
getRawAboveHierPath
in classURI
- Returns:
- the raw above hierarchy level
- Throws:
URIException
- IfURI.getRawCurrentHierPath(char[])
fails.
-
getRawPath
public char[] getRawPath()
Deprecated.Get the raw escaped path.- Overrides:
getRawPath
in classURI
- Returns:
- the path '/' if empty or undefined
-
setQuery
public void setQuery(java.lang.String queryName, java.lang.String queryValue) throws URIException, java.lang.NullPointerException
Deprecated.Set the query as the name and value pair.- Parameters:
queryName
- the query string.queryValue
- the query string.- Throws:
URIException
- incomplete trailing escape pattern Or unsupported character encodingjava.lang.NullPointerException
- null query- See Also:
URI.encode(java.lang.String, java.util.BitSet, java.lang.String)
-
setQuery
public void setQuery(java.lang.String[] queryName, java.lang.String[] queryValue) throws URIException, java.lang.NullPointerException
Deprecated.Set the query as the name and value pairs.- Parameters:
queryName
- the array of the query string.queryValue
- the array of the query string.- Throws:
URIException
- incomplete trailing escape pattern, unsupported character encoding or wrong array sizejava.lang.NullPointerException
- null query- See Also:
URI.encode(java.lang.String, java.util.BitSet, java.lang.String)
-
-