Class HttpURL

java.lang.Object
org.apache.commons.httpclient.URI
org.apache.commons.httpclient.HttpURL
All Implemented Interfaces:
Serializable, Cloneable, 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:
  • Field Details

    • DEFAULT_SCHEME

      public static final char[] DEFAULT_SCHEME
      Deprecated.
      Default scheme for HTTP URL.
    • _default_scheme

      public static final char[] _default_scheme
      Deprecated.
      Use DEFAULT_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:
    • _default_port

      public static final int _default_port
      Deprecated.
      Use DEFAULT_PORT instead. This one doesn't conform to the project naming conventions.
      Default port for HTTP URL.
      See Also:
  • Constructor Details

    • HttpURL

      public HttpURL(char[] escaped, String charset) throws URIException, 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 sequence
      charset - the charset string to do escape encoding
      Throws:
      URIException - If checkValid() fails
      NullPointerException - if escaped is null
      See Also:
    • HttpURL

      public HttpURL(char[] escaped) throws URIException, NullPointerException
      Deprecated.
      Construct a HTTP URL as an escaped form of a character array.
      Parameters:
      escaped - the HTTP URL character sequence
      Throws:
      URIException - If checkValid() fails
      NullPointerException - if escaped is null
      See Also:
    • HttpURL

      public HttpURL(String original, 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 string
      charset - the charset string to do escape encoding
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String original) throws URIException
      Deprecated.
      Construct a HTTP URL from a given string.
      Parameters:
      original - the HTTP URL string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String host, int port, String path) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      host - the host string
      port - the port number
      path - the path string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String host, int port, String path, String query) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      host - the host string
      port - the port number
      path - the path string
      query - the query string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String user, String password, String host) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      user - the user name
      password - his or her password
      host - the host string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String user, String password, String host, int port) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      user - the user name
      password - his or her password
      host - the host string
      port - the port number
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String user, String password, String host, int port, String path) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      user - the user name
      password - his or her password
      host - the host string
      port - the port number
      path - the path string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String user, String password, String host, int port, String path, String query) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      user - the user name
      password - his or her password
      host - the host string
      port - the port number
      path - the path string
      query - The query string.
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String host, String path, String query, String fragment) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      host - the host string
      path - the path string
      query - the query string
      fragment - the fragment string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String userinfo, String host, String path, String query, String fragment) throws URIException
      Deprecated.
      Construct a HTTP URL from given components. Note: The userinfo format is normally <username>:<password> where username and password must both be URL escaped.
      Parameters:
      userinfo - the userinfo string whose parts are URL escaped
      host - the host string
      path - the path string
      query - the query string
      fragment - the fragment string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String userinfo, String host, int port, String path) throws URIException
      Deprecated.
      Construct a HTTP URL from given components. Note: The userinfo format is normally <username>:<password> where username and password must both be URL escaped.
      Parameters:
      userinfo - the userinfo string whose parts are URL escaped
      host - the host string
      port - the port number
      path - the path string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String userinfo, String host, int port, String path, String query) throws URIException
      Deprecated.
      Construct a HTTP URL from given components. Note: The userinfo format is normally <username>:<password> where username and password must both be URL escaped.
      Parameters:
      userinfo - the userinfo string whose parts are URL escaped
      host - the host string
      port - the port number
      path - the path string
      query - the query string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String userinfo, String host, int port, String path, String query, String fragment) throws URIException
      Deprecated.
      Construct a HTTP URL from given components. Note: The userinfo format is normally <username>:<password> where username and password must both be URL escaped.
      Parameters:
      userinfo - the userinfo string whose parts are URL escaped
      host - the host string
      port - the port number
      path - the path string
      query - the query string
      fragment - the fragment string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(String user, String password, String host, int port, String path, String query, String fragment) throws URIException
      Deprecated.
      Construct a HTTP URL from given components.
      Parameters:
      user - the user name
      password - his or her password
      host - the host string
      port - the port number
      path - the path string
      query - the query string
      fragment - the fragment string
      Throws:
      URIException - If checkValid() fails
      See Also:
    • HttpURL

      public HttpURL(HttpURL base, String relative) throws URIException
      Deprecated.
      Construct a HTTP URL with a given relative URL string.
      Parameters:
      base - the base HttpURL
      relative - the relative HTTP URL string
      Throws:
      URIException - If checkValid() fails
    • HttpURL

      public HttpURL(HttpURL base, HttpURL relative) throws URIException
      Deprecated.
      Construct a HTTP URL with a given relative URL.
      Parameters:
      base - the base HttpURL
      relative - the relative HttpURL
      Throws:
      URIException - If checkValid() fails
  • Method Details

    • getRawScheme

      public char[] getRawScheme()
      Deprecated.
      Get the scheme. You can get the scheme explicitly.
      Overrides:
      getRawScheme in class URI
      Returns:
      the scheme
    • getScheme

      public String getScheme()
      Deprecated.
      Get the scheme. You can get the scheme explicitly.
      Overrides:
      getScheme in class URI
      Returns:
      the scheme null if empty or undefined
    • getPort

      public int getPort()
      Deprecated.
      Get the port number.
      Overrides:
      getPort in class URI
      Returns:
      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 user
      escapedPassword - 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(String escapedUser, String escapedPassword) throws URIException, NullPointerException
      Deprecated.
      Set the raw-escaped user and password.
      Parameters:
      escapedUser - the escaped user
      escapedPassword - the escaped password; could be null
      Throws:
      URIException - escaped user not valid or user required; escaped password not valid or username missed
      NullPointerException - null user
    • setUserinfo

      public void setUserinfo(String user, String password) throws URIException, NullPointerException
      Deprecated.
      Set the user and password.
      Parameters:
      user - the user
      password - the password; could be null
      Throws:
      URIException - encoding error or username missed
      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(String escapedUser) throws URIException, NullPointerException
      Deprecated.
      Set the escaped user string.
      Parameters:
      escapedUser - the escaped user string
      Throws:
      URIException - escaped user not valid
      NullPointerException - null user
    • setUser

      public void setUser(String user) throws URIException, NullPointerException
      Deprecated.
      Set the user string.
      Parameters:
      user - the user string
      Throws:
      URIException - user encoding error
      NullPointerException - null user
    • getRawUser

      public char[] getRawUser()
      Deprecated.
      Get the raw-escaped user.
      Returns:
      the raw-escaped user
    • getEscapedUser

      public String getEscapedUser()
      Deprecated.
      Get the escaped user
      Returns:
      the escaped user
    • getUser

      public String getUser() throws URIException
      Deprecated.
      Get the user.
      Returns:
      the user name
      Throws:
      URIException - If URI.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(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(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 String getEscapedPassword()
      Deprecated.
      Get the escaped password.
      Returns:
      the escaped password
    • getPassword

      public String getPassword() throws URIException
      Deprecated.
      Get the password.
      Returns:
      the password
      Throws:
      URIException - If URI.decode(char[],String) fails.
    • getRawCurrentHierPath

      public char[] getRawCurrentHierPath() throws URIException
      Deprecated.
      Get the raw-escaped current hierarchy level.
      Overrides:
      getRawCurrentHierPath in class URI
      Returns:
      the raw-escaped current hierarchy level
      Throws:
      URIException - If URI.getRawCurrentHierPath(char[]) fails.
    • getRawAboveHierPath

      public char[] getRawAboveHierPath() throws URIException
      Deprecated.
      Get the level above the this hierarchy level.
      Overrides:
      getRawAboveHierPath in class URI
      Returns:
      the raw above hierarchy level
      Throws:
      URIException - If URI.getRawCurrentHierPath(char[]) fails.
    • getRawPath

      public char[] getRawPath()
      Deprecated.
      Get the raw escaped path.
      Overrides:
      getRawPath in class URI
      Returns:
      the path '/' if empty or undefined
    • setQuery

      public void setQuery(String queryName, String queryValue) throws URIException, 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 encoding
      NullPointerException - null query
      See Also:
      • URI.encode(java.lang.String, java.util.BitSet, java.lang.String)
    • setQuery

      public void setQuery(String[] queryName, String[] queryValue) throws URIException, 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 size
      NullPointerException - null query
      See Also:
      • URI.encode(java.lang.String, java.util.BitSet, java.lang.String)