Index: examples/CustomHttpConnection.java
===================================================================
RCS file: examples/CustomHttpConnection.java
diff -N examples/CustomHttpConnection.java
--- examples/CustomHttpConnection.java 19 Jul 2003 09:41:37 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,132 +0,0 @@
-/*
- * $Header: /home/cvspublic/jakarta-commons/httpclient/src/examples/CustomHttpConnection.java,v 1.4 2003/07/19 09:41:37 olegk Exp $
- * $Revision: 1.4 $
- * $Date: 2003/07/19 09:41:37 $
- * ====================================================================
- *
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowlegement may appear in the software itself,
- * if and wherever such third-party acknowlegements normally appear.
- *
- * 4. The names "The Jakarta Project", "HttpClient", and "Apache Software
- * Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache"
- * nor may "Apache" appear in their names without prior written
- * permission of the Apache Group.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- *
* HttpMethod interface represents a request to be sent via a
@@ -517,5 +518,15 @@
* @see #getDoAuthentication()
*/
void setDoAuthentication(boolean doAuthentication);
+
+
+ /**
+ * Returns a collection of parameters associated with this method
+ *
+ * @since 2.1
+ *
+ * @see HttpMethodParams
+ */
+ public HttpMethodParams getParams();
}
Index: java/org/apache/commons/httpclient/HttpMethodBase.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
retrieving revision 1.179
diff -u -r1.179 HttpMethodBase.java
--- java/org/apache/commons/httpclient/HttpMethodBase.java 4 Sep 2003 02:12:13 -0000 1.179
+++ java/org/apache/commons/httpclient/HttpMethodBase.java 10 Sep 2003 20:34:06 -0000
@@ -87,16 +87,6 @@
*
- * When a method's request may contain a body, subclasses will typically want
- * to override:
- * true if strict mode being used
+ * @return false
*
* @see #setStrictMode(boolean)
*
+ * @deprecated Use {@link HttpClientParams#getParameter(String)}
+ * to exercise a more granular control over HTTP protocol strictness.
*/
public synchronized boolean isStrictMode() {
- return strictMode;
+ return false;
}
/**
@@ -221,10 +220,13 @@
* A timeout value of zero is interpreted as an infinite timeout.
*
* @param newTimeoutInMilliseconds Timeout in milliseconds
+ *
+ * @deprecated Use {@link HttpClientParams#setSoTimeout(int)},
+ * {@link HttpClient#getParams()}.
*
*/
public synchronized void setTimeout(int newTimeoutInMilliseconds) {
- this.timeoutInMilliseconds = newTimeoutInMilliseconds;
+ this.params.setSoTimeout(newTimeoutInMilliseconds);
}
/**
@@ -234,9 +236,12 @@
* @param timeout the timeout in milliseconds
*
* @see HttpConnectionManager#getConnection(HostConfiguration, long)
+ *
+ * @deprecated Use {@link HttpClientParams#setConnectionManagerTimeout(long)},
+ * {@link HttpClient#getParams()}
*/
public synchronized void setHttpConnectionFactoryTimeout(long timeout) {
- this.httpConnectionTimeout = timeout;
+ this.params.setConnectionManagerTimeout(timeout);
}
/**
@@ -244,9 +249,12 @@
* the timeout is not used. The default value is 0.
* @see HttpConnection#setConnectionTimeout(int)
* @param newTimeoutInMilliseconds Timeout in milliseconds.
+ *
+ * @deprecated Use {@link HttpClientParams#setConnectionTimeout(int)},
+ * {@link HttpClient#getParams()}.
*/
public synchronized void setConnectionTimeout(int newTimeoutInMilliseconds) {
- this.connectionTimeout = newTimeoutInMilliseconds;
+ this.params.setConnectionTimeout(newTimeoutInMilliseconds);
}
// --------------------------------------------------------- Public Methods
@@ -336,10 +344,7 @@
* for each item.
*/
synchronized (this) {
- methodDirector.setSoTimeout(this.timeoutInMilliseconds);
- methodDirector.setStrictMode(this.strictMode);
- methodDirector.setConnectionTimeout(this.connectionTimeout);
- methodDirector.setHttpConnectionFactoryTimeout(this.httpConnectionTimeout);
+ methodDirector.setParams(this.params);
methodDirector.setState(state == null ? getState() : state);
methodDirector.setConnectionManager(this.httpConnectionManager);
defaultHostConfiguration = getHostConfiguration();
@@ -440,6 +445,10 @@
HttpConnectionManager httpConnectionManager
) {
this.httpConnectionManager = httpConnectionManager;
+ }
+
+ public HttpParams getParams() {
+ return this.params;
}
}
Index: java/org/apache/commons/httpclient/HttpClientParams.java
===================================================================
RCS file: java/org/apache/commons/httpclient/HttpClientParams.java
diff -N java/org/apache/commons/httpclient/HttpClientParams.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/org/apache/commons/httpclient/HttpClientParams.java 10 Sep 2003 20:33:51 -0000
@@ -0,0 +1,163 @@
+/*
+ * $Header$
+ * $Revision$
+ * $Date$
+ *
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Commons", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ *
- *
*
@@ -142,16 +132,6 @@
/** Log object for this class. */
private static final Log LOG = LogFactory.getLog(HttpMethodBase.class);
- /** The User-Agent header sent on every request. */
- protected static final Header USER_AGENT;
-
- static {
- String agent = System.getProperties()
- .getProperty("httpclient.useragent",
- "Jakarta Commons-HttpClient/2.1m1");
- USER_AGENT = new Header("User-Agent", agent);
- }
-
// ----------------------------------------------------- Instance variables
/** Request headers, if any. */
@@ -195,12 +175,8 @@
* HTTP authentication challenges. */
private boolean doAuthentication = true;
- /** Version of the HTTP protocol to be used. */
- private HttpVersion version = HttpVersion.HTTP_1_1;
-
- /** True if this HTTP method should strictly follow the HTTP protocol
- * specification. */
- private boolean strictMode = false;
+ /** HTTP protocol parameters. */
+ private HttpMethodParams params = new HttpMethodParams();
/** True if this method has already been executed. */
private boolean used = false;
@@ -363,13 +339,13 @@
*
* @param http11 true to use HTTP/1.1, false to use 1.0
*
- * @deprecated Use {@link #setHttpVersion(HttpVersion)}
+ * @deprecated Use {@link HttpMethodParams#setVersion(HttpVersion)}
*/
public void setHttp11(boolean http11) {
if (http11) {
- this.version = HttpVersion.HTTP_1_1;
+ this.params.setVersion(HttpVersion.HTTP_1_1);
} else {
- this.version = HttpVersion.HTTP_1_0;
+ this.params.setVersion(HttpVersion.HTTP_1_0);
}
}
@@ -407,10 +383,10 @@
*
* @return true to use HTTP/1.1, false to use 1.0
*
- * @deprecated Use {@link #getHttpVersion()}
+ * @deprecated Use {@link HttpMethodParams#getVersion()}
*/
public boolean isHttp11() {
- return this.version.equals(HttpVersion.HTTP_1_1);
+ return getHttpVersion().equals(HttpVersion.HTTP_1_1);
}
/**
@@ -837,18 +813,26 @@
* which many HTTP servers expect.
*
* @param strictMode true for strict mode, false otherwise
+ *
+ * @deprecated Use {@link HttpParams#setParameter(String, Object)} to exercise
+ * a more granular control over HTTP protocol strictness.
*/
public void setStrictMode(boolean strictMode) {
- this.strictMode = strictMode;
+ if (strictMode) {
+ this.params.makeStrict();
+ } else {
+ this.params.makeLenient();
+ }
}
/**
- * Returns the value of the strict mode flag.
+ * @deprecated Use {@link HttpParams#setParameter(String, Object)} to exercise
+ * a more granular control over HTTP protocol strictness.
*
- * @return true if strict mode is enabled, false otherwise
+ * @return false
*/
public boolean isStrictMode() {
- return strictMode;
+ return false;
}
/**
@@ -933,16 +917,17 @@
}
LOG.debug("Resorting to protocol version default close connection policy");
// missing or invalid connection header, do the default
- if (this.version.greaterEquals(HttpVersion.HTTP_1_1)) {
+ HttpVersion version = getHttpVersion();
+ if (version.greaterEquals(HttpVersion.HTTP_1_1)) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Should NOT close connection, using " + this.version.toString());
+ LOG.debug("Should NOT close connection, using " + version.toString());
}
} else {
if (LOG.isDebugEnabled()) {
- LOG.debug("Should close connection, using " + this.version.toString());
+ LOG.debug("Should close connection, using " + version.toString());
}
}
- return this.version.lessEquals(HttpVersion.HTTP_1_0);
+ return version.lessEquals(HttpVersion.HTTP_1_0);
}
/**
@@ -971,21 +956,13 @@
}
/**
- * Execute this HTTP method. Note that we cannot currently support redirects
- * that change the connection parameters (host, port, protocol) because
- * we don't yet have a good way to get the new connection. For the time
- * being, we just return the redirect response code, and allow the user
- * agent to resubmit if desired.
+ * Executes this method using the specified HttpConnection and
+ * HttpState.
*
* @param state {@link HttpState state} information to associate with this
* request. Must be non-null.
* @param conn the {@link HttpConnection connection} to used to execute
* this HTTP method. Must be non-null.
- * Note that we cannot currently support redirects that
- * change the HttpConnection parameters (host, port, protocol)
- * because we don't yet have a good way to get the new connection.
- * For the time being, we just return the 302 response, and allow
- * the user agent to resubmit if desired.
*
* @return the integer status code if one was obtained, or -1
*
@@ -1054,7 +1031,7 @@
getResponseTrailerHeaderGroup().clear();
statusLine = null;
used = false;
- version = HttpVersion.HTTP_1_1;
+ params = new HttpMethodParams();
responseBody = null;
recoverableExceptionCount = 0;
connectionCloseForced = false;
@@ -1179,7 +1156,7 @@
Cookie[] cookies = matcher.match(conn.getHost(), conn.getPort(),
getPath(), conn.isSecure(), state.getCookies());
if ((cookies != null) && (cookies.length > 0)) {
- if (this.isStrictMode()) {
+ if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
// In strict mode put all cookies on the same header
getRequestHeaderGroup().addHeader(
matcher.formatCookieHeader(cookies));
@@ -1362,8 +1339,12 @@
LOG.trace("enter HttpMethodBase.addUserAgentRequestHeaders(HttpState, "
+ "HttpConnection)");
- if (getRequestHeader("user-agent") == null) {
- setRequestHeader(HttpMethodBase.USER_AGENT);
+ if (getRequestHeader("User-Agent") == null) {
+ String agent = (String)getParams().getParameter(HttpMethodParams.USER_AGENT);
+ if (agent == null) {
+ agent = "Jakarta Commons-HttpClient";
+ }
+ setRequestHeader("User-Agent", agent);
}
}
@@ -1726,14 +1707,14 @@
if (conn.isResponseAvailable(conn.getSoTimeout())) {
result = new ChunkedInputStream(is, this);
} else {
- if (isStrictMode()) {
+ if (getParams().isParameterTrue(HttpMethodParams.STRICT_TRANSFER_ENCODING)) {
throw new ProtocolException("Chunk-encoded body declared but not sent");
} else {
LOG.warn("Chunk-encoded body missing");
}
}
} else {
- if (isStrictMode() && LOG.isWarnEnabled()) {
+ if (LOG.isWarnEnabled()) {
LOG.warn("Transfer-Encoding is set but does not contain \"chunked\": "
+ transferEncoding);
}
@@ -1861,14 +1842,15 @@
//check for a valid HTTP-Version
String versionStr = statusLine.getHttpVersion();
- if (!this.strictMode && versionStr.equals("HTTP")) {
- this.version = HttpVersion.HTTP_1_0;
+ if (getParams().isParameterFalse(HttpMethodParams.UNAMBIGUOUS_STATUS_LINE)
+ && versionStr.equals("HTTP")) {
+ getParams().setVersion(HttpVersion.HTTP_1_0);
if (LOG.isWarnEnabled()) {
LOG.warn("Ambiguous status line (HTTP protocol version missing):" +
statusLine.toString());
}
} else {
- this.version = HttpVersion.parse(versionStr);
+ getParams().setVersion(HttpVersion.parse(versionStr));
}
}
@@ -1930,6 +1912,7 @@
Wire.output("\r\n");
}
+ HttpVersion ver = getParams().getVersion();
Header expectheader = getRequestHeader("Expect");
String expectvalue = null;
if (expectheader != null) {
@@ -1937,7 +1920,7 @@
}
if ((expectvalue != null)
&& (expectvalue.compareToIgnoreCase("100-continue") == 0)) {
- if (this.isHttp11()) {
+ if (ver.greaterEquals(HttpVersion.HTTP_1_1)) {
int readTimeout = conn.getSoTimeout();
try {
conn.setSoTimeout(RESPONSE_WAIT_TIME_MS);
@@ -2089,28 +2072,26 @@
}
/**
- * Get the HTTP version to be used with this method.
+ * Returns {@link HttpParams HTTP protocol parameters}.
*
- * @return HTTP version.
+ * @return HTTP parameters.
*
* @since 2.1
*/
- public HttpVersion getHttpVersion() {
- return this.version;
+ public HttpMethodParams getParams() {
+ return this.params;
}
/**
- * Set the HTTP version to be used with this method.
+ * Returns the HTTP version to be used with this method.
+ *
+ * @return HTTP version.
*
* @since 2.1
*/
- public void setHttpVersion(HttpVersion version) {
- if (version == null) {
- this.version = HttpVersion.HTTP_1_1;
- } else {
- this.version = version;
- }
- }
+ protected HttpVersion getHttpVersion() {
+ return this.params.getVersion();
+ }
/**
* Per RFC 2616 section 4.3, some response can never contain a message
Index: java/org/apache/commons/httpclient/HttpMethodDirector.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodDirector.java,v
retrieving revision 1.2
diff -u -r1.2 HttpMethodDirector.java
--- java/org/apache/commons/httpclient/HttpMethodDirector.java 12 Aug 2003 18:46:47 -0000 1.2
+++ java/org/apache/commons/httpclient/HttpMethodDirector.java 10 Sep 2003 20:34:10 -0000
@@ -95,13 +95,7 @@
private HttpConnection connection;
- private int soTimeout;
-
- private int connectionTimeout;
-
- private boolean strictMode;
-
- private long httpConnectionFactoryTimeout;
+ private HttpClientParams params;
/** A flag to indicate if the connection should be released after the method is executed. */
private boolean releaseConnection = false;
@@ -129,7 +123,7 @@
*/
public void executeMethod() throws IOException, HttpException {
- method.setStrictMode(strictMode);
+ method.getParams().setDefaults(this.params);
try {
int forwardCount = 0; //protect from an infinite loop
@@ -188,7 +182,7 @@
private void addPreemtiveAuthenticationHeaders() {
//pre-emptively add the authorization header, if required.
- if (state.isAuthenticationPreemptive()) {
+ if (this.params.isAuthenticationPreemptive()) {
LOG.debug("Preemptively sending default basic credentials");
@@ -230,7 +224,7 @@
if (connection == null) {
connection = connectionManager.getConnectionWithTimeout(
hostConfiguration,
- httpConnectionFactoryTimeout
+ this.params.getConnectionManagerTimeout()
);
connection.setLocked(true);
@@ -248,8 +242,8 @@
if (!connection.isOpen()) {
// this connection must be opened before it can be used
- connection.setSoTimeout(soTimeout);
- connection.setConnectionTimeout(connectionTimeout);
+ connection.setSoTimeout(this.params.getSoTimeout());
+ connection.setConnectionTimeout(this.params.getConnectionTimeout());
connection.open();
if (connection.isProxied() && connection.isSecure()) {
// we need to create a secure tunnel before we can execute the real method
@@ -708,57 +702,15 @@
/**
* @return
*/
- public int getConnectionTimeout() {
- return connectionTimeout;
- }
-
- /**
- * @param connectionTimeout
- */
- public void setConnectionTimeout(int connectionTimeout) {
- this.connectionTimeout = connectionTimeout;
- }
-
- /**
- * @return
- */
- public long getHttpConnectionFactoryTimeout() {
- return httpConnectionFactoryTimeout;
- }
-
- /**
- * @param httpConnectionFactoryTimeout
- */
- public void setHttpConnectionFactoryTimeout(long httpConnectionTimeout) {
- this.httpConnectionFactoryTimeout = httpConnectionTimeout;
- }
-
- /**
- * @return
- */
- public int getSoTimeout() {
- return soTimeout;
- }
-
- /**
- * @param soTimeout
- */
- public void setSoTimeout(int soTimeout) {
- this.soTimeout = soTimeout;
- }
-
- /**
- * @return
- */
- public boolean isStrictMode() {
- return strictMode;
+ public HttpParams getParams() {
+ return this.params;
}
/**
- * @param strictMode
+ * @param params
*/
- public void setStrictMode(boolean strictMode) {
- this.strictMode = strictMode;
+ public void setParams(final HttpClientParams params) {
+ this.params = params;
}
}
Index: java/org/apache/commons/httpclient/HttpMethodParams.java
===================================================================
RCS file: java/org/apache/commons/httpclient/HttpMethodParams.java
diff -N java/org/apache/commons/httpclient/HttpMethodParams.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/org/apache/commons/httpclient/HttpMethodParams.java 10 Sep 2003 20:34:11 -0000
@@ -0,0 +1,132 @@
+/*
+ * $Header$
+ * $Revision$
+ * $Date$
+ *
+ * ====================================================================
+ *
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
+ *
+ * 4. The names "The Jakarta Project", "Commons", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ *