org.apache.commons.httpclient

Class URIException

Implemented Interfaces:
Serializable

public class URIException
extends HttpException

The URI parsing and escape encoding exception.
See Also:
Serialized Form

Field Summary

static int
ESCAPING
The URI escape encoding and decoding error.
static int
PARSING
The URI parsing error.
static int
PUNYCODE
The DNS punycode encoding or decoding error.
static int
UNKNOWN
No specified reason code.
static int
UNSUPPORTED_ENCODING
The unsupported character encoding.
protected String
reason
The reason message.
protected int
reasonCode
The reason code.

Constructor Summary

URIException()
Default constructor.
URIException(int reasonCode)
The constructor with a reason code argument.
URIException(int reasonCode, String reason)
The constructor with a reason string and its code arguments.
URIException(String reason)
The constructor with a reason string argument.

Method Summary

String
getReason()
Deprecated. You should instead call getMessage().
int
getReasonCode()
Get the reason code.
void
setReason(String reason)
Deprecated. Callers should instead set this via a parameter to the constructor.
void
setReasonCode(int reasonCode)
Deprecated. Callers should set the reason code as a parameter to the constructor.

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

getCause, getReason, getReasonCode, printStackTrace, printStackTrace, printStackTrace, setReason, setReasonCode

Methods inherited from class java.lang.Throwable

fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

Methods inherited from class java.lang.Object

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

Field Details

ESCAPING

public static final int ESCAPING
The URI escape encoding and decoding error.
Field Value:
3

PARSING

public static final int PARSING
The URI parsing error.
Field Value:
1

PUNYCODE

public static final int PUNYCODE
The DNS punycode encoding or decoding error.
Field Value:
4

UNKNOWN

public static final int UNKNOWN
No specified reason code.
Field Value:
0

UNSUPPORTED_ENCODING

public static final int UNSUPPORTED_ENCODING
The unsupported character encoding.
Field Value:
2

reason

protected String reason
The reason message.

reasonCode

protected int reasonCode
The reason code.

Constructor Details

URIException

public URIException()
Default constructor.

URIException

public URIException(int reasonCode)
The constructor with a reason code argument.
Parameters:
reasonCode - the reason code
Usages and Demos :

View More Examples of URIException(int reasonCode)
   1:         } catch (DecoderException e) {
   2:             throw new URIException(e.getMessage());
   3:         }
   4:     }

View Full Code Here
   1:         if (uuri.getRawURI().length > UURI.MAX_URL_LENGTH) {
   2:            throw new URIException("Created (escaped) uuri > " +
   3:               UURI.MAX_URL_LENGTH +": "+uuri.toString());
   4:         ...
   5:             } else {
   6:                 URIException ue = new URIException(e+" "+label);
   7:                 ue.initCause(e);
   8:                 throw ue;
   9:             }

View Full Code Here

URIException

public URIException(int reasonCode,
                    String reason)
The constructor with a reason string and its code arguments.
Parameters:
reasonCode - the reason code
reason - the reason

URIException

public URIException(String reason)
The constructor with a reason string argument.
Parameters:
reason - the reason
Usages and Demos :

View More Examples of URIException(String reason)
   1:         } catch (DecoderException e) {
   2:             throw new URIException(e.getMessage());
   3:         }
   4:     }

View Full Code Here
   1:         if (uuri.getRawURI().length > UURI.MAX_URL_LENGTH) {
   2:            throw new URIException("Created (escaped) uuri > " +
   3:               UURI.MAX_URL_LENGTH +": "+uuri.toString());
   4:         ...
   5:             } else {
   6:                 URIException ue = new URIException(e+" "+label);
   7:                 ue.initCause(e);
   8:                 throw ue;
   9:             }

View Full Code Here

Method Details

getReason

public String getReason()

Deprecated. You should instead call getMessage().

Get the reason message.
Overrides:
getReason in interface HttpException
Returns:
the reason message

getReasonCode

public int getReasonCode()
Get the reason code.
Overrides:
getReasonCode in interface HttpException
Returns:
the reason code

setReason

public void setReason(String reason)

Deprecated. Callers should instead set this via a parameter to the constructor.

Set the reason message.
Overrides:
setReason in interface HttpException
Parameters:
reason - the reason message

setReasonCode

public void setReasonCode(int reasonCode)

Deprecated. Callers should set the reason code as a parameter to the constructor.

Set the reason code.
Overrides:
setReasonCode in interface HttpException
Parameters:
reasonCode - the reason code