org.apache.commons.httpclient

Class HttpURL

Implemented Interfaces:
Cloneable, Comparable<T>, Serializable
Known Direct Subclasses:
HttpsURL

public class HttpURL
extends URI

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

static int
DEFAULT_PORT
Default port for HTTP URL.
static char[]
DEFAULT_SCHEME
Default scheme for HTTP URL.
static int
_default_port
Deprecated. Use DEFAULT_PORT instead.
static char[]
_default_scheme
Deprecated. Use DEFAULT_SCHEME instead.

Fields inherited from class org.apache.commons.httpclient.URI

IPv4address, IPv6address, IPv6reference, URI_reference, _authority, _fragment, _host, _is_IPv4address, _is_IPv6reference, _is_abs_path, _is_hier_part, _is_hostname, _is_net_path, _is_opaque_part, _is_reg_name, _is_rel_path, _is_server, _opaque, _path, _port, _query, _scheme, _uri, _userinfo, abs_path, absoluteURI, allowed_IPv6reference, allowed_abs_path, allowed_authority, allowed_fragment, allowed_host, 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, alpha, alphanum, authority, control, defaultDocumentCharset, defaultDocumentCharsetByLocale, defaultDocumentCharsetByPlatform, defaultProtocolCharset, delims, digit, disallowed_opaque_part, disallowed_rel_path, domainlabel, escaped, fragment, hash, hex, hier_part, host, hostname, hostport, mark, net_path, opaque_part, param, path, path_segments, pchar, percent, port, protocolCharset, query, reg_name, rel_path, rel_segment, relativeURI, reserved, rootPath, scheme, segment, server, space, toplabel, unreserved, unwise, uric, uric_no_slash, userinfo, within_userinfo

Constructor Summary

HttpURL()
Create an instance as an internal use.
HttpURL(char[] escaped)
Construct a HTTP URL as an escaped form of a character array.
HttpURL(char[] escaped, String charset)
Construct a HTTP URL as an escaped form of a character array with the given charset to do escape encoding.
HttpURL(String original)
Construct a HTTP URL from a given string.
HttpURL(String host, int port, String path)
Construct a HTTP URL from given components.
HttpURL(String host, int port, String path, String query)
Construct a HTTP URL from given components.
HttpURL(String original, String charset)
Construct a HTTP URL from a given string with the given charset to do escape encoding.
HttpURL(String userinfo, String host, int port, String path)
Construct a HTTP URL from given components.
HttpURL(String userinfo, String host, int port, String path, String query)
Construct a HTTP URL from given components.
HttpURL(String userinfo, String host, int port, String path, String query, String fragment)
Construct a HTTP URL from given components.
HttpURL(String user, String password, String host)
Construct a HTTP URL from given components.
HttpURL(String user, String password, String host, int port)
Construct a HTTP URL from given components.
HttpURL(String user, String password, String host, int port, String path)
Construct a HTTP URL from given components.
HttpURL(String user, String password, String host, int port, String path, String query)
Construct a HTTP URL from given components.
HttpURL(String user, String password, String host, int port, String path, String query, String fragment)
Construct a HTTP URL from given components.
HttpURL(String host, String path, String query, String fragment)
Construct a HTTP URL from given components.
HttpURL(String userinfo, String host, String path, String query, String fragment)
Construct a HTTP URL from given components.
HttpURL(HttpURL base, String relative)
Construct a HTTP URL with a given relative URL string.
HttpURL(HttpURL base, HttpURL relative)
Construct a HTTP URL with a given relative URL.

Method Summary

protected void
checkValid()
Verify the valid class use for construction.
String
getEscapedPassword()
Get the escaped password.
String
getEscapedUser()
Get the escaped user
String
getPassword()
Get the password.
int
getPort()
Get the port number.
char[]
getRawAboveHierPath()
Get the level above the this hierarchy level.
char[]
getRawCurrentHierPath()
Get the raw-escaped current hierarchy level.
char[]
getRawPassword()
Get the raw-escaped password.
char[]
getRawPath()
Get the raw escaped path.
char[]
getRawScheme()
Get the scheme.
char[]
getRawUser()
Get the raw-escaped user.
String
getScheme()
Get the scheme.
String
getUser()
Get the user.
void
setEscapedPassword(String escapedPassword)
Set the escaped password string.
void
setEscapedUser(String escapedUser)
Set the escaped user string.
void
setEscapedUserinfo(String escapedUser, String escapedPassword)
Set the raw-escaped user and password.
void
setPassword(String password)
Set the password string.
void
setQuery(String queryName, String queryValue)
Set the query as the name and value pair.
void
setQuery(String[] queryName, String[] queryValue)
Set the query as the name and value pairs.
void
setRawPassword(char[] escapedPassword)
Set the raw-escaped password.
void
setRawUser(char[] escapedUser)
Set the raw-escaped user.
void
setRawUserinfo(char[] escapedUser, char[] escapedPassword)
Set the raw-escaped user and password.
protected void
setURI()
Once it's parsed successfully, set this URI.
void
setUser(String user)
Set the user string.
void
setUserinfo(String user, String password)
Set the user and password.
protected static String
toUserinfo(String user, String password)

Methods inherited from class org.apache.commons.httpclient.URI

clone, compareTo, decode, decode, encode, equals, equals, getAboveHierPath, getAuthority, getCurrentHierPath, getDefaultDocumentCharset, getDefaultDocumentCharsetByLocale, getDefaultDocumentCharsetByPlatform, getDefaultProtocolCharset, getEscapedAboveHierPath, getEscapedAuthority, getEscapedCurrentHierPath, getEscapedFragment, getEscapedName, getEscapedPath, getEscapedPathQuery, getEscapedQuery, getEscapedURI, getEscapedURIReference, getEscapedUserinfo, getFragment, getHost, getName, getPath, getPathQuery, getPort, getProtocolCharset, getQuery, getRawAboveHierPath, getRawAuthority, getRawCurrentHierPath, getRawCurrentHierPath, getRawFragment, getRawHost, getRawName, getRawPath, getRawPathQuery, getRawQuery, getRawScheme, getRawURI, getRawURIReference, getRawUserinfo, getScheme, getURI, getURIReference, getUserinfo, hasAuthority, hasFragment, hasQuery, hasUserinfo, hashCode, indexFirstOf, indexFirstOf, indexFirstOf, indexFirstOf, isAbsPath, isAbsoluteURI, isHierPart, isHostname, isIPv4address, isIPv6reference, isNetPath, isOpaquePart, isRegName, isRelPath, isRelativeURI, isServer, normalize, normalize, parseAuthority, parseUriReference, prevalidate, removeFragmentIdentifier, resolvePath, setDefaultDocumentCharset, setDefaultProtocolCharset, setEscapedAuthority, setEscapedFragment, setEscapedPath, setEscapedQuery, setFragment, setPath, setQuery, setRawAuthority, setRawFragment, setRawPath, setRawQuery, setURI, toString, validate, validate

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

DEFAULT_PORT

public static final int DEFAULT_PORT
Default port for HTTP URL.
Field Value:
80

DEFAULT_SCHEME

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

_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.
Field Value:
80

_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.

Constructor Details

HttpURL

protected HttpURL()
Create an instance as an internal use.

HttpURL

public HttpURL(char[] escaped)
            throws URIException,
                   NullPointerException
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
Usages and Demos :

View More Examples of HttpURL(char[] escaped)
   1:     {
   2:         HttpURL url = new HttpURL(uri);
   3: 
   4:         if (resource == null)
   5:         {

View Full Code Here
   1:             try {
   2:                 HttpURL url = new HttpURL( quoteURL.toString() );
   3:                 url.setQuery( "symbol", symbol );
   4:                 
   5:                 GetMethod getMethod = new GetMethod( url.toString() );

View Full Code Here
   1:     public static boolean saveString(String data, String url, String username, String password) throws HttpException, URIException, IOException {
   2:     HttpURL httpURL = new HttpURL(url);
   3:     String parentPath = null;
   4:     HttpURL parentURL = null;
   5:     WebdavResource parentResource = null;

View Full Code Here
   1:         try {
   2:             httpURL = new HttpURL(url);
   3:             if (user == null || user.length() == 0)
   4:         ...
   5:             try {
   6:                 HttpURL parentURL = new HttpURL(httpURL.toString());
   7:                 String user = httpURL.getUser();
   8:                 String pass = httpURL.getPassword();
   9:                 if (user != null)

View Full Code Here
   1:   {
   2:       HttpURL httpURL = new HttpURL(url);
   3:       String parentPath = null;
   4:         ...
   5: 
   6:       HttpURL httpURL = new HttpURL(url);
   7:       String parentPath = null;
   8:         ...
   9:         if (check) {
  10:             HttpURL url = new HttpURL(s);
  11:             url.setUserinfo(mUser,mPassword);

View Full Code Here

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.
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
Usages and Demos :

View More Examples of HttpURL(char[] escaped,String charset)
   1:         return false;
   2:         parentURL = new HttpURL(httpURL, parentPath);
   3:         if ((password != null) && (username != null)) {
   4:         parentURL.setUserinfo(username, password);
   5:         }

View Full Code Here
   1:               return false;
   2:           parentURL = new HttpURL(httpURL, parentPath);
   3:           if ((password != null) && (username != null)) {
   4:         ...
   5:           }
   6:           parentURL = new HttpURL(httpURL, parentPath);
   7:           if ( (password != null) && (username != null)) {
   8:               parentURL.setUserinfo(username, password);
   9:           parentResource = resourceIfExists(parentURL);

View Full Code Here

HttpURL

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

View More Examples of HttpURL(String original)
   1:     {
   2:         HttpURL url = new HttpURL(uri);
   3: 
   4:         if (resource == null)
   5:         {

View Full Code Here
   1:             try {
   2:                 HttpURL url = new HttpURL( quoteURL.toString() );
   3:                 url.setQuery( "symbol", symbol );
   4:                 
   5:                 GetMethod getMethod = new GetMethod( url.toString() );

View Full Code Here
   1:     public static boolean saveString(String data, String url, String username, String password) throws HttpException, URIException, IOException {
   2:     HttpURL httpURL = new HttpURL(url);
   3:     String parentPath = null;
   4:     HttpURL parentURL = null;
   5:     WebdavResource parentResource = null;

View Full Code Here
   1:         try {
   2:             httpURL = new HttpURL(url);
   3:             if (user == null || user.length() == 0)
   4:         ...
   5:             try {
   6:                 HttpURL parentURL = new HttpURL(httpURL.toString());
   7:                 String user = httpURL.getUser();
   8:                 String pass = httpURL.getPassword();
   9:                 if (user != null)

View Full Code Here
   1:   {
   2:       HttpURL httpURL = new HttpURL(url);
   3:       String parentPath = null;
   4:         ...
   5: 
   6:       HttpURL httpURL = new HttpURL(url);
   7:       String parentPath = null;
   8:         ...
   9:         if (check) {
  10:             HttpURL url = new HttpURL(s);
  11:             url.setUserinfo(mUser,mPassword);

View Full Code Here

HttpURL

public HttpURL(String host,
               int port,
               String path)
            throws URIException
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

HttpURL

public HttpURL(String host,
               int port,
               String path,
               String query)
            throws URIException
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

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.
Parameters:
original - the HTTP URL string
charset - the charset string to do escape encoding
Throws:
URIException - If checkValid() fails
See Also:
HttpURL
Usages and Demos :

View More Examples of HttpURL(String original,String charset)
   1:         return false;
   2:         parentURL = new HttpURL(httpURL, parentPath);
   3:         if ((password != null) && (username != null)) {
   4:         parentURL.setUserinfo(username, password);
   5:         }

View Full Code Here
   1:               return false;
   2:           parentURL = new HttpURL(httpURL, parentPath);
   3:           if ((password != null) && (username != null)) {
   4:         ...
   5:           }
   6:           parentURL = new HttpURL(httpURL, parentPath);
   7:           if ( (password != null) && (username != null)) {
   8:               parentURL.setUserinfo(username, password);
   9:           parentResource = resourceIfExists(parentURL);

View Full Code Here

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.
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

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.
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

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.
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

HttpURL

public HttpURL(String user,
               String password,
               String host)
            throws URIException
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

HttpURL

public HttpURL(String user,
               String password,
               String host,
               int port)
            throws URIException
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

HttpURL

public HttpURL(String user,
               String password,
               String host,
               int port,
               String path)
            throws URIException
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

HttpURL

public HttpURL(String user,
               String password,
               String host,
               int port,
               String path,
               String query)
            throws URIException
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

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.
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

HttpURL

public HttpURL(String host,
               String path,
               String query,
               String fragment)
            throws URIException
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

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.
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

HttpURL

public HttpURL(HttpURL base,
               String relative)
            throws URIException
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
Usages and Demos :

View More Examples of HttpURL(HttpURL base,String relative)
   1:         return false;
   2:         parentURL = new HttpURL(httpURL, parentPath);
   3:         if ((password != null) && (username != null)) {
   4:         parentURL.setUserinfo(username, password);
   5:         }

View Full Code Here
   1:               return false;
   2:           parentURL = new HttpURL(httpURL, parentPath);
   3:           if ((password != null) && (username != null)) {
   4:         ...
   5:           }
   6:           parentURL = new HttpURL(httpURL, parentPath);
   7:           if ( (password != null) && (username != null)) {
   8:               parentURL.setUserinfo(username, password);
   9:           parentResource = resourceIfExists(parentURL);

View Full Code Here

HttpURL

public HttpURL(HttpURL base,
               HttpURL relative)
            throws URIException
Construct a HTTP URL with a given relative URL.
Parameters:
base - the base HttpURL
relative - the relative HttpURL
Throws:
URIException - If checkValid() fails
Usages and Demos :

View More Examples of HttpURL(HttpURL base,HttpURL relative)
   1:         return false;
   2:         parentURL = new HttpURL(httpURL, parentPath);
   3:         if ((password != null) && (username != null)) {
   4:         parentURL.setUserinfo(username, password);
   5:         }

View Full Code Here
   1:               return false;
   2:           parentURL = new HttpURL(httpURL, parentPath);
   3:           if ((password != null) && (username != null)) {
   4:         ...
   5:           }
   6:           parentURL = new HttpURL(httpURL, parentPath);
   7:           if ( (password != null) && (username != null)) {
   8:               parentURL.setUserinfo(username, password);
   9:           parentResource = resourceIfExists(parentURL);

View Full Code Here

Method Details

checkValid

protected void checkValid()
            throws URIException
Verify the valid class use for construction.
Throws:
URIException - the wrong scheme use

getEscapedPassword

public String getEscapedPassword()
Get the escaped password.
Returns:
the escaped password

getEscapedUser

public String getEscapedUser()
Get the escaped user
Returns:
the escaped user

getPassword

public String getPassword()
            throws URIException
Get the password.
Returns:
the password
Usages and Demos :

View More Examples of getPassword()
   1: import org.apache.commons.httpclient.HttpException;
   2: import org.apache.commons.httpclient.HttpURL;
   3: import org.apache.commons.httpclient.URIException;
   4:         ...
   5: 
   6:     private HttpURL httpURL;
   7: 
   8:         ...
   9:             if (pass == null || pass.length() == 0)
  10:                 pass = httpURL.getPassword();
  11:             if (user != null)
  12:         ...
  13:                 String user = httpURL.getUser();
  14:                 String pass = httpURL.getPassword();

View Full Code Here

getPort

public int getPort()
Get the port number.
Overrides:
getPort in interface URI
Returns:
the port number

getRawAboveHierPath

public char[] getRawAboveHierPath()
            throws URIException
Get the level above the this hierarchy level.
Overrides:
getRawAboveHierPath in interface URI
Returns:
the raw above hierarchy level

getRawCurrentHierPath

public char[] getRawCurrentHierPath()
            throws URIException
Get the raw-escaped current hierarchy level.
Overrides:
getRawCurrentHierPath in interface URI
Returns:
the raw-escaped current hierarchy level

getRawPassword

public char[] getRawPassword()
Get the raw-escaped password.
Returns:
the raw-escaped password

getRawPath

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

getRawScheme

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

getRawUser

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

getScheme

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

getUser

public String getUser()
            throws URIException
Get the user.
Returns:
the user name
Throws:
URIException - If HttpURL fails
Usages and Demos :

View More Examples of getUser()
   1: import org.apache.commons.httpclient.HttpException;
   2: import org.apache.commons.httpclient.HttpURL;
   3: import org.apache.commons.httpclient.URIException;
   4:         ...
   5: 
   6:     private HttpURL httpURL;
   7: 
   8:         ...
   9:             if (user == null || user.length() == 0)
  10:                 user = httpURL.getUser();
  11:             if (pass == null || pass.length() == 0)
  12:         ...
  13:                 HttpURL parentURL = new HttpURL(httpURL.toString());
  14:                 String user = httpURL.getUser();

View Full Code Here

setEscapedPassword

public void setEscapedPassword(String escapedPassword)
            throws URIException
Set the escaped password string.
Parameters:
escapedPassword - the escaped password string; could be null
Throws:
URIException - escaped password not valid or username missed

setEscapedUser

public void setEscapedUser(String escapedUser)
            throws URIException,
                   NullPointerException
Set the escaped user string.
Parameters:
escapedUser - the escaped user string
Throws:
URIException - escaped user not valid
NullPointerException - null user

setEscapedUserinfo

public void setEscapedUserinfo(String escapedUser,
                               String escapedPassword)
            throws URIException,
                   NullPointerException
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

setPassword

public void setPassword(String password)
            throws URIException
Set the password string.
Parameters:
password - the password string; could be null
Throws:
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.
Parameters:
queryName - the query string.
queryValue - the query string.
Throws:
URIException - incomplete trailing escape pattern Or unsupported character encoding
NullPointerException - null query
See Also:
HttpURL
Usages and Demos :

View More Examples of setQuery(String queryName,String queryValue)
   1: import org.apache.commons.httpclient.HttpClient;
   2: import org.apache.commons.httpclient.HttpURL;
   3: import org.apache.commons.httpclient.methods.GetMethod;
   4:         ...
   5:             try {
   6:                 HttpURL url = new HttpURL( quoteURL.toString() );
   7:         ...
   8:                 url.setQuery( "symbol", symbol );
   9:                 

View Full Code Here

setQuery

public void setQuery(String[] queryName,
                     String[] queryValue)
            throws URIException,
                   NullPointerException
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:
HttpURL
Usages and Demos :

View More Examples of setQuery(String[] queryName,String[] queryValue)
   1: import org.apache.commons.httpclient.HttpClient;
   2: import org.apache.commons.httpclient.HttpURL;
   3: import org.apache.commons.httpclient.methods.GetMethod;
   4:         ...
   5:             try {
   6:                 HttpURL url = new HttpURL( quoteURL.toString() );
   7:         ...
   8:                 url.setQuery( "symbol", symbol );
   9:                 

View Full Code Here

setRawPassword

public void setRawPassword(char[] escapedPassword)
            throws URIException
Set the raw-escaped password.
Parameters:
escapedPassword - the raw-escaped password; could be null
Throws:
URIException - escaped password not valid or username missed

setRawUser

public void setRawUser(char[] escapedUser)
            throws URIException
Set the raw-escaped user.
Parameters:
escapedUser - the raw-escaped user
Throws:
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.
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

setURI

protected void setURI()
Once it's parsed successfully, set this URI.
Overrides:
setURI in interface URI
See Also:
HttpURL

setUser

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

setUserinfo

public void setUserinfo(String user,
                        String password)
            throws URIException,
                   NullPointerException
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
Usages and Demos :

View More Examples of setUserinfo(String user,String password)
   1: import org.apache.commons.httpclient.HttpException;
   2: import org.apache.commons.httpclient.HttpURL;
   3: 
   4:         ...
   5:     {
   6:         HttpURL url = new HttpURL(uri);
   7: 
   8:         ...
   9:         {
  10:             url.setUserinfo(username, password);
  11:             resource = new WebdavResource(url);

View Full Code Here
   1: import org.apache.commons.httpclient.HttpException;
   2: import org.apache.commons.httpclient.HttpURL;
   3: import org.apache.commons.httpclient.URIException;
   4:         ...
   5: 
   6:     private HttpURL httpURL;
   7: 
   8:         ...
   9:             if (user != null)
  10:                 httpURL.setUserinfo(user, pass);
  11:         } catch (URIException e) {
  12:         ...
  13:                 if (user != null)
  14:                     parentURL.setUserinfo(user, pass);

View Full Code Here

toUserinfo

protected static String toUserinfo(String user,
                                   String password)
            throws URIException