You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ol...@apache.org on 2003/07/06 00:31:21 UTC
cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestAuthenticator.java TestHttpState.java TestHttps.java TestMethodsExternalHost.java TestWebappBasicAuth.java
olegk 2003/07/05 15:31:21
Modified: httpclient/src/java/org/apache/commons/httpclient
Cookie.java HttpClient.java HttpConnection.java
HttpState.java
MultiThreadedHttpConnectionManager.java URI.java
httpclient/src/java/org/apache/commons/httpclient/util
URIUtil.java
httpclient/src/test/org/apache/commons/httpclient
TestAuthenticator.java TestHttpState.java
TestHttps.java TestMethodsExternalHost.java
TestWebappBasicAuth.java
Removed: httpclient/src/java/org/apache/commons/httpclient
Authenticator.java HttpUrlMethod.java
RequestOutputStream.java ResponseInputStream.java
Log:
Deprecated methods in Cookie, HttpClient, HttpConnection, HttpState, URI, URIUtil classes removed. Deprecated classes Authenticator, HttpUrlMethod, RequestOutputStream, ResponseInputStream removed.
Revision Changes Path
1.39 +4 -293 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java
Index: Cookie.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- Cookie.java 4 Feb 2003 21:22:07 -0000 1.38
+++ Cookie.java 5 Jul 2003 22:31:20 -0000 1.39
@@ -473,172 +473,6 @@
}
/**
- * Return <tt>true</tt> if I should be submitted with a request with given
- * attributes, <tt>false</tt> otherwise.
- * @param domain the host to which the request is being submitted
- * @param port the port to which the request is being submitted (currently
- * ignored)
- * @param path the path to which the request is being submitted
- * @param secure <tt>true</tt> if the request is using the HTTPS protocol
- * @param date the time at which the request is submitted
- * @return true if the cookie matches
- *
- * @deprecated use {@link CookieSpec} interface
- */
- public boolean matches(
- String domain, int port, String path, boolean secure, Date date) {
-
- LOG.trace("enter Cookie.matches(Strinng, int, String, boolean, Date");
- CookieSpec matcher = CookiePolicy.getDefaultSpec();
- return matcher.match(domain, port, path, secure, this);
- }
-
- /**
- * Return <tt>true</tt> if I should be submitted with a request with given
- * attributes, <tt>false</tt> otherwise.
- * @param domain the host to which the request is being submitted
- * @param port the port to which the request is being submitted (currently
- * ignored)
- * @param path the path to which the request is being submitted
- * @param secure True if this cookie has the secure flag set
- * @return true if I should be submitted as above.
- * @deprecated use {@link CookieSpec} interface
- */
- public boolean matches(
- String domain, int port, String path, boolean secure) {
- LOG.trace("enter Cookie.matches(String, int, String, boolean");
- return matches(domain, port, path, secure, new Date());
- }
-
- /**
- * Create a <tt>Cookie</tt> header containing
- * all non-expired cookies in <i>cookies</i>,
- * associated with the given <i>domain</i> and
- * <i>path</i>, assuming the connection is not
- * secure.
- * <p>
- * If no cookies match, returns null.
- *
- * @param domain The domain
- * @param path The path
- * @param cookies The cookies to use
- * @return The new header.
- * @deprecated use {@link CookieSpec} interface
- */
- public static Header createCookieHeader(String domain, String path,
- Cookie[] cookies) {
-
- LOG.trace("enter Cookie.createCookieHeader(String,String,Cookie[])");
- return Cookie.createCookieHeader(domain, path, false, cookies);
- }
-
- /**
- * Create a <tt>Cookie</tt> header containing
- * all non-expired cookies in <i>cookies</i>,
- * associated with the given <i>domain</i>, <i>path</i> and
- * <i>https</i> setting.
- * <p>
- * If no cookies match, returns null.
- *
- * @param domain The domain
- * @param path The path
- * @param secure True if this cookie has the secure flag set
- * @param cookies The cookies to use.
- * @return The new header
- * @exception IllegalArgumentException if domain or path is null
- *
- * @deprecated use {@link CookieSpec} interface
- */
- public static Header createCookieHeader(String domain, String path,
- boolean secure, Cookie[] cookies)
- throws IllegalArgumentException {
-
- LOG.trace("enter Cookie.createCookieHeader("
- + "String, String, boolean, Cookie[])");
-
- // Make sure domain isn't null here. Path will be validated in
- // subsequent call to createCookieHeader
- if (domain == null) {
- throw new IllegalArgumentException("null domain in "
- + "createCookieHeader.");
- }
- // parse port from domain, if any
- int port = secure ? 443 : 80;
- int ndx = domain.indexOf(":");
- if (ndx != -1) {
- try {
- port = Integer.parseInt(domain.substring(ndx + 1,
- domain.length()));
- } catch (NumberFormatException e) {
- // ignore?, but at least LOG
- LOG.warn("Cookie.createCookieHeader(): "
- + "Invalid port number in domain " + domain);
- }
- }
- return Cookie.createCookieHeader(domain, port, path, secure, cookies);
- }
-
- /**
- * Create a <tt>Cookie</tt> header containing
- * all non-expired cookies in <i>cookies</i>,
- * associated with the given <i>domain</i>, <i>port</i>,
- * <i>path</i> and <i>https</i> setting.
- * <p>
- * If no cookies match, returns null.
- *
- * @param domain The domain
- * @param port The port
- * @param path The path
- * @param secure True if this cookie has the secure flag set
- * @param cookies The cookies to use.
- * @return The new header
- * @throws IllegalArgumentException if domain or path is null
- *
- * @deprecated use {@link CookieSpec} interface
- */
- public static Header createCookieHeader(String domain, int port,
- String path, boolean secure, Cookie[] cookies)
- throws IllegalArgumentException {
- LOG.trace("enter Cookie.createCookieHeader(String, int, String, boolean, Cookie[])");
- return Cookie.createCookieHeader(domain, port, path, secure, new Date(), cookies);
- }
-
- /**
- * Create a <tt>Cookie</tt> header containing all cookies in <i>cookies</i>,
- * associated with the given <i>domain</i>, <i>port</i>, <i>path</i> and
- * <i>https</i> setting, and which are not expired according to the given
- * <i>date</i>.
- * <p>
- * If no cookies match, returns null.
- *
- * @param domain The domain
- * @param port The port
- * @param path The path
- * @param secure True if this cookie has the secure flag set
- * @param now The date to check for expiry
- * @param cookies The cookies to use.
- * @return The new header
- * @throws IllegalArgumentException if domain or path is null
- *
- * @deprecated use {@link CookieSpec} interface
- */
-
- public static Header createCookieHeader(
- String domain, int port, String path, boolean secure,
- Date now, Cookie[] cookies)
- throws IllegalArgumentException {
-
- LOG.trace("enter Cookie.createCookieHeader(String, int, String, boolean, Date, Cookie[])");
- CookieSpec matcher = CookiePolicy.getDefaultSpec();
- cookies = matcher.match(domain, port, path, secure, cookies);
- if ((cookies != null) && (cookies.length > 0)) {
- return matcher.formatCookieHeader(cookies);
- } else {
- return null;
- }
- }
-
- /**
* <p>Compares two cookies to determine order for cookie header.</p>
* <p>Most specific should be first. </p>
* <p>This method is implemented so a cookie can be used as a comparator for
@@ -688,129 +522,6 @@
*/
public String toString() {
return toExternalForm();
- }
-
- /**
- * Parses the Set-Cookie {@link Header} into an array of
- * <tt>Cookie</tt>s, assuming that the cookies were recieved
- * on an insecure channel.
- *
- * @param domain the domain from which the {@link Header} was received
- * @param port the port from which the {@link Header} was received
- * (currently ignored)
- * @param path the path from which the {@link Header} was received
- * @param setCookie the <tt>Set-Cookie</tt> {@link Header} received from the
- * server
- * @return an array of <tt>Cookie</tt>s parsed from the Set-Cookie {@link
- * Header}
- * @throws HttpException if an exception occurs during parsing
- * @throws IllegalArgumentException if domain or path are null
- */
- public static Cookie[] parse(
- String domain, int port, String path, Header setCookie)
- throws HttpException, IllegalArgumentException {
-
- LOG.trace("enter Cookie.parse(String, int, String, Header)");
- return Cookie.parse(domain, port, path, false, setCookie);
- }
-
- /**
- * Parses the Set-Cookie {@link Header} into an array of
- * <tt>Cookie</tt>s, assuming that the cookies were recieved
- * on an insecure channel.
- *
- * @param domain the domain from which the {@link Header} was received
- * @param path the path from which the {@link Header} was received
- * @param setCookie the <tt>Set-Cookie</tt> {@link Header} received from the
- * server
- * @return an array of <tt>Cookie</tt>s parsed from the Set-Cookie {@link
- * Header}
- * @throws HttpException if an exception occurs during parsing
- * @throws IllegalArgumentException if domain or path are null
- *
- * @deprecated use {@link CookieSpec} interface
- */
- public static Cookie[] parse(String domain, String path, Header setCookie)
- throws HttpException, IllegalArgumentException {
- LOG.trace("enter Cookie.parse(String, String, Header)");
- return Cookie.parse (domain, 80, path, false, setCookie);
- }
-
- /**
- * Parses the Set-Cookie {@link Header} into an array of
- * <tt>Cookie</tt>s.
- *
- * @param domain the domain from which the {@link Header} was received
- * @param path the path from which the {@link Header} was received
- * @param secure <tt>true</tt> when the header was recieved over a secure
- * channel
- * @param setCookie the <tt>Set-Cookie</tt> {@link Header} received from the
- * server
- * @return an array of <tt>Cookie</tt>s parsed from the Set-Cookie {@link
- * Header}
- * @throws HttpException if an exception occurs during parsing
- * @throws IllegalArgumentException if domain or path are null
- *
- * @deprecated use {@link CookieSpec} interface
- */
- public static Cookie[] parse(String domain, String path,
- boolean secure, Header setCookie)
- throws HttpException, IllegalArgumentException {
-
- LOG.trace ("enter Cookie.parse(String, String, boolean, Header)");
- return Cookie.parse (
- domain, (secure ? 443 : 80), path, secure, setCookie);
- }
-
- /**
- * Parses the Set-Cookie {@link Header} into an array of
- * <tt>Cookie</tt>s.
- *
- * <P>The syntax for the Set-Cookie response header is:
- *
- * <PRE>
- * set-cookie = "Set-Cookie:" cookies
- * cookies = 1#cookie
- * cookie = NAME "=" VALUE * (";" cookie-av)
- * NAME = attr
- * VALUE = value
- * cookie-av = "Comment" "=" value
- * | "Domain" "=" value
- * | "Max-Age" "=" value
- * | "Path" "=" value
- * | "Secure"
- * | "Version" "=" 1*DIGIT
- * </PRE>
- *
- * @param domain the domain from which the {@link Header} was received
- * @param port The port from which the {@link Header} was received.
- * @param path the path from which the {@link Header} was received
- * @param secure <tt>true</tt> when the {@link Header} was received over
- * HTTPS
- * @param setCookie the <tt>Set-Cookie</tt> {@link Header} received from
- * the server
- * @return an array of <tt>Cookie</tt>s parsed from the Set-Cookie {@link
- * Header}
- * @throws HttpException if an exception occurs during parsing
- *
- * @deprecated use {@link CookieSpec} interface
- */
- public static Cookie[] parse(String domain, int port, String path,
- boolean secure, Header setCookie)
- throws HttpException {
-
- LOG.trace("enter Cookie.parse(String, int, String, boolean, Header)");
-
- CookieSpec parser = CookiePolicy.getDefaultSpec();
- Cookie[] cookies = parser.parse(domain, port, path, secure, setCookie);
-
- for (int i = 0; i < cookies.length; i++) {
- final Cookie cookie = cookies[i];
- final CookieSpec validator
- = CookiePolicy.getSpecByVersion(cookie.getVersion());
- validator.validate(domain, port, path, secure, cookie);
- }
- return cookies;
}
// ----------------------------------------------------- Instance Variables
1.78 +4 -246 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java
Index: HttpClient.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- HttpClient.java 5 Jul 2003 18:51:24 -0000 1.77
+++ HttpClient.java 5 Jul 2003 22:31:20 -0000 1.78
@@ -64,11 +64,9 @@
package org.apache.commons.httpclient;
import java.io.IOException;
-import java.net.URL;
import java.security.Security;
import java.security.Provider;
-import org.apache.commons.httpclient.protocol.Protocol;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -253,237 +251,6 @@
// --------------------------------------------------------- Public Methods
/**
- * @deprecated use hostConfiguration
- *
- * Sets the host, port and protocol(http) to be used when executing a
- * method.
- *
- * @param host the host to connect to
- * @param port the port to connect to
- *
- * @see #getHostConfiguration()
- */
- public void startSession(String host, int port) {
- LOG.trace("enter HttpClient.startSession(String, int)");
- startSession(host, port, false);
- }
-
- /**
- * @deprecated use hostConfiguration
- *
- * Sets the host, port and protocol to be used when executing a method.
- *
- * @param host the host to connect to
- * @param port the port to connect to
- * @param https when <code>true</code>, create an HTTPS session
- *
- * @see #getHostConfiguration()
- */
- public void startSession(String host, int port, boolean https) {
- LOG.trace("enter HttpClient.startSession(String, int, boolean)");
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("HttpClient.startSession(String,int,boolean): Host:"
- + host + " Port:" + port + " HTTPS:" + https);
- }
-
- this.hostConfiguration.setHost(host, port, https ? "https" : "http");
- }
-
- /**
- * @deprecated use hostConfiguration and httpState
- *
- * Sets the host, port, protocol(http) and credentials to be used when
- * executing a method.
- *
- * @param host the host to connect to
- * @param port the port to connect to
- * @param creds the default credentials to use
- *
- * @see #getHostConfiguration()
- * @see #getState()
- * @see #startSession(String, int, Credentials, boolean)
- */
- public void startSession(String host, int port, Credentials creds) {
- LOG.trace("enter HttpClient.startSession(String, int, Credentials)");
- startSession(host, port, creds, false);
- }
-
- /**
- * @deprecated use hostConfiguration and httpState
- *
- * Sets the host, port, protocol and credentials to be used when executing a
- * method.
- *
- * @param host the host to connect to
- * @param port the port to connect to
- * @param creds the default credentials to use
- * @param https when <code>true</code>, create an HTTPS session
- *
- * @see #getHostConfiguration()
- * @see #getState()
- */
- public void startSession(String host, int port, Credentials creds, boolean https) {
- LOG.trace("enter HttpClient.startSession(String, int, Credentials, boolean)");
-
- if (LOG.isDebugEnabled()) {
- LOG.debug(
- "Starting HttpClient session"
- + " Host:" + host
- + " Port:" + port + " Credentials:" + creds
- + " HTTPS:" + https);
- }
- getState().setCredentials(null, creds);
- this.hostConfiguration.setHost(
- host,
- port,
- https ? "https" : "http"
- );
- }
-
- /**
- * @deprecated use hostConfiguration and httpState
- *
- * Sets the host, port, protocol and credentials to be used when executing a
- * method using the server specified by the scheme, userinfo, host and port
- * of the given <i>uri</i>.
- * <p>
- * Note that the path component is not utilized.
- * <p>
- * @param uri an <code>HttpURL</code> or <code>HttpsURL</code> instance; the
- * {@link URI URI} from which the scheme, userinfo, host and port of the
- * session are determined
- *
- * @throws IllegalStateException not enough information to process
- * @throws URIException If the URI is bad.
- *
- * @see #getHostConfiguration()
- * @see #getState()
- */
- public void startSession(URI uri)
- throws URIException, IllegalStateException {
-
- LOG.trace("enter HttpClient.startSession(URI)");
-
- String scheme = uri.getScheme();
- if (scheme == null) { // it may a URI instance or abs_path
- LOG.error("no scheme to start a session");
- throw new IllegalStateException("no scheme to start a session");
- }
-
- Protocol protocol = Protocol.getProtocol(scheme);
-
- String userinfo = uri.getUserinfo();
- if (userinfo != null) {
- getState().setCredentials(null,
- new UsernamePasswordCredentials(userinfo));
- }
- String host = uri.getHost();
- if (host == null || host.length() == 0) {
- LOG.error("no host to start a session");
- throw new IllegalStateException("no host to start a session");
- }
- int port = uri.getPort();
- if (port == -1) { // neither HttpURL or HttpsURL instance
- LOG.error("HttpURL or HttpsURL instance required");
- throw new IllegalStateException
- ("HttpURL or HttpsURL instance required");
- }
- this.hostConfiguration.setHost(host, null, port, protocol);
- }
-
- /**
- * @deprecated use hostConfiguration
- *
- * Sets the host, port and protocol to be used when executing a method.
- * <p>
- * Note that everything but the protocol, host and port of the
- * given <i>url</i> is ignored.
- * </p>
- * @param url the {@link URL URL} from which the protocol, host, and port of
- * the session are determined
- *
- * @exception IllegalArgumentException if the protocol is not http or https
- *
- * @see #getHostConfiguration()
- */
- public void startSession(URL url) throws IllegalArgumentException {
- LOG.trace("enter HttpClient.startSession(String, int, Credentials, boolean)");
-
- int port = url.getPort();
- Protocol protocol = Protocol.getProtocol(url.getProtocol());
-
- hostConfiguration.setHost(url.getHost(), null, port, protocol);
- }
-
- /**
- * @deprecated use hostConfiguration and httpState
- *
- * Sets the host, port, protocol and credentials to be used when executing a
- * method.
- * <p>
- * Note that everything but the protocol, host and port of the
- * given <i>url</i> is ignored.
- * </p>
- * @param url the {@link URL URL} from which the protocol, host, and port of
- * the session are determined
- * @param creds the default credentials to use
- *
- * @exception IllegalArgumentException if the protocol is not http or https
- *
- * @see #getHostConfiguration()
- * @see #getState()
- */
- public void startSession(URL url, Credentials creds)
- throws IllegalArgumentException {
-
- LOG.trace("enter HttpClient.startSession(URL, Credentials)");
- getState().setCredentials(null, creds);
- startSession(url);
- }
-
- /**
- * @deprecated use hostConfiguration
- *
- * Sets the host, port, protocol(http) and proxy to be used when executing a
- * method.
- *
- * @param host the host to connect to
- * @param port the port to connect to
- * @param proxyhost the proxy host to connect via
- * @param proxyport the proxy port to connect via
- *
- * @see #getHostConfiguration()
- */
- public void startSession(String host, int port, String proxyhost, int proxyport) {
- LOG.trace("enter HttpClient.startSession(String, int, String, int)");
- startSession(host, port, proxyhost, proxyport, false);
- }
-
- /**
- * @deprecated use hostConfiguration
- *
- * Sets the host, port, protocol and proxy to be used when executing a
- * method.
- *
- * @param host the host to connect to
- * @param port the port to connect to
- * @param proxyhost the proxy host to connect via
- * @param proxyport the proxy port to connect via
- * @param secure whether or not to connect using HTTPS
- *
- * @see #getHostConfiguration()
- */
- public void startSession(String host, int port,
- String proxyhost, int proxyport, boolean secure) {
-
- LOG.trace("enter HttpClient.startSession("
- + "String, int, String, int, boolean)");
- this.hostConfiguration.setHost (host, port, secure ? "https" : "http");
- this.hostConfiguration.setProxy(proxyhost, proxyport);
- }
-
- /**
* Executes the given method.
*
* @param method the {@link HttpMethod} to execute.
@@ -633,15 +400,6 @@
}
return method.execute(state, connection);
- }
-
- /**
- * @deprecated this method has no effect. HttpMethod.releaseConnection()
- * should be used to release resources after a HttpMethod has been executed.
- *
- * @see HttpMethod#releaseConnection()
- */
- public void endSession() throws IOException {
}
/**
1.68 +6 -106 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java
Index: HttpConnection.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpConnection.java,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- HttpConnection.java 26 May 2003 22:07:21 -0000 1.67
+++ HttpConnection.java 5 Jul 2003 22:31:20 -0000 1.68
@@ -125,23 +125,7 @@
* @param port the port I should connect to
*/
public HttpConnection(String host, int port) {
- this(null, -1, host, port, false);
- }
-
- /**
- * Constructor.
- *
- * @param host the host I should connect to
- * @param port the port I should connect to
- * @param secure when <tt>true</tt>, connect via HTTPS (SSL)
- *
- * @deprecated use HttpConnection(String, int, Protocol)
- *
- * @see #HttpConnection(String,int,Protocol)
- *
- */
- public HttpConnection(String host, int port, boolean secure) {
- this(null, -1, host, port, secure);
+ this(null, -1, host, null, port, Protocol.getProtocol("http"));
}
/**
@@ -180,31 +164,7 @@
int proxyPort,
String host,
int port) {
- this(proxyHost, proxyPort, host, port, false);
- }
-
- /**
- * Fully-specified constructor.
- *
- * @param proxyHost the host I should proxy via
- * @param proxyPort the port I should proxy via
- * @param host the host I should connect to. Parameter value must be non-null.
- * @param port the port I should connect to
- * @param secure when <tt>true</tt>, connect via HTTPS (SSL)
- *
- * @deprecated use HttpConnection(String, int, String, int, Protocol)
- *
- * @see #HttpConnection(String, int, String, String, int, Protocol)
- *
- */
- public HttpConnection(
- String proxyHost,
- int proxyPort,
- String host,
- int port,
- boolean secure) {
- this(proxyHost, proxyPort, host, null, port,
- Protocol.getProtocol(secure ? "https" : "http"));
+ this(proxyHost, proxyPort, host, null, port, Protocol.getProtocol("http"));
}
/**
@@ -416,23 +376,6 @@
}
/**
- * Set whether or not I should connect over HTTPS (SSL).
- *
- * @param secure whether or not I should connect over HTTPS (SSL).
- * @throws IllegalStateException if I am already connected
- *
- * @deprecated use setProtocol(Protocol)
- *
- * @see #setProtocol(Protocol)
- */
- public void setSecure(boolean secure) throws IllegalStateException {
- assertNotOpen();
- protocolInUse = secure
- ? Protocol.getProtocol("https")
- : Protocol.getProtocol("http");
- }
-
- /**
* Sets the protocol used by this connection.
*
* @param protocol The new protocol.
@@ -799,49 +742,6 @@
out = new WireLogOutputStream(out);
}
return out;
- }
-
- /**
- * Return a {@link OutputStream} suitable for writing (possibly
- * chunked) bytes to my {@link OutputStream}.
- *
- * @param useChunking when <tt>true</tt> the chunked transfer-encoding will
- * be used
- * @throws IllegalStateException if I am not connected
- * @throws IOException if an I/O problem occurs
- * @return a stream to write the request to
- * @deprecated Use new ChunkedOutputStream(httpConnecion.getRequestOutputStream());
- */
- public OutputStream getRequestOutputStream(boolean useChunking)
- throws IOException, IllegalStateException {
- LOG.trace("enter HttpConnection.getRequestOutputStream(boolean)");
-
- OutputStream out = getRequestOutputStream();
- if (useChunking) {
- out = new ChunkedOutputStream(out);
- }
- return out;
- }
-
- /**
- * Return a {@link InputStream} suitable for reading (possibly
- * chunked) bytes from my {@link InputStream}.
- * <p>
- * If the given {@link HttpMethod} contains
- * a <tt>Transfer-Encoding: chunked</tt> header,
- * the returned stream will be configured
- * to read chunked bytes.
- *
- * @param method This argument is ignored.
- * @throws IllegalStateException if I am not connected
- * @throws IOException if an I/O problem occurs
- * @return a stream to read the response from
- * @deprecated Use getResponseInputStream() instead.
- */
- public InputStream getResponseInputStream(HttpMethod method)
- throws IOException, IllegalStateException {
- LOG.trace("enter HttpConnection.getResponseInputStream(HttpMethod)");
- return getResponseInputStream();
}
/**
1.24 +4 -134 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java
Index: HttpState.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- HttpState.java 5 Jul 2003 18:51:24 -0000 1.23
+++ HttpState.java 5 Jul 2003 22:31:20 -0000 1.24
@@ -249,33 +249,6 @@
* @param port the request port
* @param path the request path
* @param secure <code>true</code> when using HTTPS
- * @param now the {@link Date} by which expiration is determined
- * @return an array of my {@link Cookie}s.
- *
- * @see Cookie#matches
- * @see #getCookies()
- *
- * @deprecated use HttpState.getCookies(String, int, String, boolean)
- */
- public synchronized Cookie[] getCookies(
- String domain,
- int port,
- String path,
- boolean secure,
- Date now
- ) {
- return getCookies(domain, port, path, secure);
- }
-
-
- /**
- * Obtain an array of my {@link Cookie}s that
- * match the given request parameters.
- *
- * @param domain the request domain
- * @param port the request port
- * @param path the request path
- * @param secure <code>true</code> when using HTTPS
* @return an array of my {@link Cookie}s.
*
* @see Cookie#matches
@@ -382,34 +355,6 @@
this.cookiePolicy = policy;
}
- /**
- * Set the Credentials for the given authentication realm.
- *
- * When <i>realm</i> is <code>null</code>, I'll use the given
- * <i>credentials</i> when no other {@link Credentials} have
- * been supplied for the given challenging realm.
- * (I.e., use a <code>null</code> realm to set the "default"
- * credentials.)
- * <p>
- * Any previous credentials for this realm will be overwritten.
- *
- * @deprecated This method does not distinguish between realms with the
- * same name on different hosts. Use
- * {@link HttpState#setCredentials(String, Credentials)} instead.
- *
- * @param realm the authentication realm
- * @param credentials the authentication credentials for the given realm
- *
- * @see #getCredentials(String, String)
- * @see #setProxyCredentials(String, String, Credentials)
- *
- */
-
- public synchronized void setCredentials(String realm, Credentials credentials) {
- LOG.trace("enter HttpState.setCredentials(String, Credentials)");
- setCredentials(realm, null, credentials);
- }
-
/** Sets the credentials for <tt>realm</tt> on <tt>host</tt>.
* with no host.
*
@@ -495,61 +440,6 @@
}
/**
- * Get the Credentials for the given authentication realm.
- *
- * If the <i>realm</i> exists on <i>host</i>, return the coresponding credentials.
- * If the <i>realm</i> exists with a <tt>null</tt> <i>host</i>, return the
- * corresponding credentials. If the <i>realm</i> does not exist, return
- * the default Credentials. If there is no default credentials, return
- * <code>null</code>.
- *
- * @deprecated This method does not distinguish between realms on different
- * servers with the same name. Use {@link #getCredentials(String, String)}
- * instead.
- *
- * @param realm the authentication realm
- * @return the credentials
- *
- * @see #setCredentials(String, String, Credentials)
- *
- */
-
- public synchronized Credentials getCredentials(String realm) {
- LOG.trace("enter HttpState.getCredentials(String)");
-
- return getCredentials(realm, null);
- }
-
- /**
- * Set the for the proxy with the given authentication realm.
- *
- * When <i>realm</i> is <code>null</code>, I'll use the given
- * <i>credentials</i> when no other {@link Credentials} have
- * been supplied for the given challenging realm.
- * (I.e., use a <code>null</code> realm to set the "default"
- * credentials.) Realms rarely make much sense with proxies, so
- * <code>null</code> is normally a good choice here.
- * <p>
- * Any previous credentials for this realm will be overwritten.
- *
- * @deprecated This method does not differentiate between realms with
- * the same name on different servers. Use
- * {@link #setProxyCredentials(String, String, Credentials)} instead.
- *
- * @param realm the authentication realm
- * @param credentials the authentication credentials for the given realm
- *
- * @see #getProxyCredentials(String)
- * @see #setCredentials(String, Credentials)
- *
- */
-
- public synchronized void setProxyCredentials(String realm, Credentials credentials) {
- LOG.trace("enter HttpState.setProxyCredentials(String, credentials)");
- setProxyCredentials(realm, null, credentials);
- }
-
- /**
* Set the credentials for the proxy with the given authentication realm.
*
* When <i>realm</i> and <i>proxyHost</i> are <code>null</code>, I'll use the given
@@ -578,26 +468,6 @@
proxyCred.put(new HttpAuthRealm(proxyHost, realm), credentials);
}
- /**
- * Get the Credentials for the proxy with the given authentication realm.
- *
- * If the <i>realm</i> exists, return the coresponding credentials. If the
- * <i>realm</i> does not exist, return the default Credentials. If there is
- * no default credentials, return <code>null</code>.
- *
- * @deprecated This method does not distinguish between realms on different hosts.
- * Use {@link #getProxyCredentials(String, String)} instead.
- *
- * @param realm the authentication realm
- * @return the credentials
- * @see #setProxyCredentials(String, String, Credentials)
- */
-
- public synchronized Credentials getProxyCredentials(String realm) {
- LOG.trace("enter HttpState.getProxyCredentials(String)");
- return getProxyCredentials(realm, null);
- }
-
/**
* Get the Credentials for the proxy with the given authentication realm on the given
* <i>host</i>.
1.18 +3 -29 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java
Index: MultiThreadedHttpConnectionManager.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- MultiThreadedHttpConnectionManager.java 27 Jun 2003 03:20:32 -0000 1.17
+++ MultiThreadedHttpConnectionManager.java 5 Jul 2003 22:31:20 -0000 1.18
@@ -785,15 +785,6 @@
}
}
- public OutputStream getRequestOutputStream(boolean useChunking)
- throws IOException, IllegalStateException {
- if (hasConnection()) {
- return wrappedConnection.getRequestOutputStream(useChunking);
- } else {
- return null;
- }
- }
-
public InputStream getResponseInputStream()
throws IOException, IllegalStateException {
if (hasConnection()) {
@@ -803,15 +794,6 @@
}
}
- public InputStream getResponseInputStream(HttpMethod method)
- throws IOException, IllegalStateException {
- if (hasConnection()) {
- return wrappedConnection.getResponseInputStream(method);
- } else {
- return null;
- }
- }
-
public boolean isOpen() {
if (hasConnection()) {
return wrappedConnection.isOpen();
@@ -972,14 +954,6 @@
public void setProxyPort(int port) throws IllegalStateException {
if (hasConnection()) {
wrappedConnection.setProxyPort(port);
- } else {
- // do nothing
- }
- }
-
- public void setSecure(boolean secure) throws IllegalStateException {
- if (hasConnection()) {
- wrappedConnection.setSecure(secure);
} else {
// do nothing
}
1.37 +4 -18 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java
Index: URI.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- URI.java 1 Jul 2003 01:12:29 -0000 1.36
+++ URI.java 5 Jul 2003 22:31:20 -0000 1.37
@@ -71,7 +71,6 @@
import java.util.Locale;
import java.util.BitSet;
import java.util.Hashtable;
-import java.net.URL;
import java.security.AccessController;
import sun.security.action.GetPropertyAction;
@@ -221,19 +220,6 @@
*/
public URI(String original) throws URIException {
parseUriReference(original, false);
- }
-
-
- /**
- * Construct a URI from a URL.
- *
- * @param url a valid URL.
- * @throws URIException If the URI cannot be created.
- * @since 2.0
- * @deprecated currently somewhat wrong and diffrent with java.net.URL usage
- */
- public URI(URL url) throws URIException {
- this(url.toString());
}
1.22 +4 -115 jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/util/URIUtil.java
Index: URIUtil.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/util/URIUtil.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- URIUtil.java 29 Jun 2003 21:34:06 -0000 1.21
+++ URIUtil.java 5 Jul 2003 22:31:21 -0000 1.22
@@ -63,7 +63,6 @@
package org.apache.commons.httpclient.util;
-import java.io.UnsupportedEncodingException;
import java.util.BitSet;
import org.apache.commons.httpclient.URI;
import org.apache.commons.httpclient.URIException;
@@ -573,116 +572,6 @@
throws URIException {
return Coder.decode(escaped.toCharArray(), charset);
- }
-
- // --------------------------------- transforming a string between charsets
-
- /**
- * Convert a target string to the specified character encoded string with
- * the default protocol charset.
- *
- * @param target a target string
- * @return the protocol character encoded string
- *
- * @throws URIException if the default protocol charset is not supported
- *
- * @see URI#getDefaultProtocolCharset
- *
- * @deprecated Do not use. To be removed
- */
- public static String toProtocolCharset(String target) throws URIException {
- return toUsingCharset(
- target,
- URI.getDefaultDocumentCharset(),
- URI.getDefaultProtocolCharset());
- }
-
-
- /**
- * Convert a target string to the specified character encoded string with
- * a given protocol charset.
- *
- * @param target a target string
- * @param charset the transformed protocol charset
- * @return the protocol character encoded string
- *
- * @throws URIException if the charset is not supported
- *
- * @deprecated Do not use. To be removed
- */
- public static String toProtocolCharset(String target, String charset)
- throws URIException {
-
- return toUsingCharset(target, URI.getDefaultDocumentCharset(), charset);
- }
-
-
- /**
- * Convert a target string to the specified character encoded string with
- * the default document charset.
- *
- * @param target a target string
- * @return the document character encoded string
- *
- * @throws URIException if the default protocol charset is not supported
- *
- * @see URI#getDefaultDocumentCharset
- *
- * @deprecated Do not use. To be removed
- */
- public static String toDocumentCharset(String target) throws URIException {
- return toUsingCharset(target, URI.getDefaultProtocolCharset(),
- URI.getDefaultDocumentCharset());
- }
-
-
- /**
- * Convert a target string to the specified character encoded string with
- * a given document charset.
- *
- * @param target a target string
- * @param charset the transformed document charset
- * @return the document character encoded string
- *
- * @throws URIException if the charset is not supported
- *
- * @deprecated Do not use. To be removed
- */
- public static String toDocumentCharset(String target, String charset)
- throws URIException {
-
- return toUsingCharset(target, URI.getDefaultProtocolCharset(), charset);
- }
-
-
- /**
- * Convert a target string from the <code>fromCharset</code> charset to
- * the <code>toCharset</code> charset.
- * <p>
- * What if the document charset is ISO-8859-1 and the protocol charset is
- * UTF-8, when it's read from the document part and is used in the protocol
- * part, the use of the method will be <code>toUsingCharset(the string,
- * "ISO-8859-1", "UTF-8")</code>.
- *
- * @param target a target string
- * @param fromCharset the previous charset
- * @param toCharset the changing charset
- * @return the document character encoded string
- *
- * @throws URIException if either of the charsets are not supported
- *
- * @deprecated Do not use. To be removed
- */
-
- public static String toUsingCharset(String target, String fromCharset,
- String toCharset) throws URIException {
-
- try {
- return new String(target.getBytes(fromCharset), toCharset);
- } catch (UnsupportedEncodingException error) {
- throw new URIException(URIException.UNSUPPORTED_ENCODING,
- error.getMessage());
- }
}
// ---------------------------------------------------------- Inner classes
1.26 +6 -6 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestAuthenticator.java
Index: TestAuthenticator.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestAuthenticator.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- TestAuthenticator.java 22 Apr 2003 17:00:26 -0000 1.25
+++ TestAuthenticator.java 5 Jul 2003 22:31:21 -0000 1.26
@@ -641,7 +641,7 @@
public void testMultipleProxyChallengeBasic() throws Exception {
HttpState state = new HttpState();
- state.setProxyCredentials("Protected", new UsernamePasswordCredentials("name", "pass"));
+ state.setProxyCredentials("Protected", null, new UsernamePasswordCredentials("name", "pass"));
HttpMethod method = new SimpleHttpMethod();
SimpleHttpConnection conn = new SimpleHttpConnection();
conn.addResponse(
@@ -667,7 +667,7 @@
public void testMultipleProxyChallengeDigest() throws Exception {
HttpState state = new HttpState();
- state.setProxyCredentials("Protected", new UsernamePasswordCredentials("name", "pass"));
+ state.setProxyCredentials("Protected", null, new UsernamePasswordCredentials("name", "pass"));
HttpMethod method = new SimpleHttpMethod();
SimpleHttpConnection conn = new SimpleHttpConnection();
conn.addResponse(
1.4 +22 -22 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestHttpState.java
Index: TestHttpState.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestHttpState.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestHttpState.java 23 Jan 2003 22:48:27 -0000 1.3
+++ TestHttpState.java 5 Jul 2003 22:31:21 -0000 1.4
@@ -106,10 +106,10 @@
public void testHttpStateCredentials() {
HttpState state = new HttpState();
- state.setCredentials(realm1, creds1);
- state.setCredentials(realm2, creds2);
- assertEquals(creds1, state.getCredentials(realm1));
- assertEquals(creds2, state.getCredentials(realm2));
+ state.setCredentials(realm1, null, creds1);
+ state.setCredentials(realm2, null, creds2);
+ assertEquals(creds1, state.getCredentials(realm1, null));
+ assertEquals(creds2, state.getCredentials(realm2, null));
}
public void testToString()
@@ -123,44 +123,44 @@
state.addCookie(new Cookie("flub", "duck", "yuck"));
assertNotNull(state.toString());
- state.setCredentials(realm1, creds1);
+ state.setCredentials(realm1, null, creds1);
assertNotNull(state.toString());
- state.setProxyCredentials(realm2, creds2);
+ state.setProxyCredentials(realm2, null, creds2);
assertNotNull(state.toString());
}
public void testHttpStateNoCredentials() {
HttpState state = new HttpState();
- assertEquals(null, state.getCredentials("bogus"));
+ assertEquals(null, state.getCredentials("bogus", null));
}
public void testHttpStateDefaultCredentials() {
HttpState state = new HttpState();
- state.setCredentials(null, creds1);
- state.setCredentials(realm2, creds2);
- assertEquals(creds1, state.getCredentials("bogus"));
+ state.setCredentials(null, null, creds1);
+ state.setCredentials(realm2, null, creds2);
+ assertEquals(creds1, state.getCredentials("bogus", null));
}
public void testHttpStateProxyCredentials() {
HttpState state = new HttpState();
- state.setProxyCredentials(realm1, creds1);
- state.setProxyCredentials(realm2, creds2);
- assertEquals(creds1, state.getProxyCredentials(realm1));
- assertEquals(creds2, state.getProxyCredentials(realm2));
+ state.setProxyCredentials(realm1, null, creds1);
+ state.setProxyCredentials(realm2, null, creds2);
+ assertEquals(creds1, state.getProxyCredentials(realm1, null));
+ assertEquals(creds2, state.getProxyCredentials(realm2, null));
}
public void testHttpStateProxyNoCredentials() {
HttpState state = new HttpState();
- assertEquals(null, state.getProxyCredentials("bogus"));
+ assertEquals(null, state.getProxyCredentials("bogus", null));
}
public void testHttpStateProxyDefaultCredentials() {
HttpState state = new HttpState();
- state.setProxyCredentials(null, creds1);
- state.setProxyCredentials(realm2, creds2);
- assertEquals(creds1, state.getProxyCredentials("bogus"));
+ state.setProxyCredentials(null, null, creds1);
+ state.setProxyCredentials(realm2, null, creds2);
+ assertEquals(creds1, state.getProxyCredentials("bogus", null));
}
}
1.10 +6 -6 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestHttps.java
Index: TestHttps.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestHttps.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TestHttps.java 2 Feb 2003 11:05:19 -0000 1.9
+++ TestHttps.java 5 Jul 2003 22:31:21 -0000 1.10
@@ -118,7 +118,7 @@
if (PROXY_HOST != null) {
if (PROXY_USER != null) {
HttpState state = client.getState();
- state.setProxyCredentials(null, new UsernamePasswordCredentials(
+ state.setProxyCredentials(null, null, new UsernamePasswordCredentials(
PROXY_USER, PROXY_PASS));
}
client.getHostConfiguration().setProxy(PROXY_HOST, Integer.parseInt(PROXY_PORT));
@@ -147,7 +147,7 @@
if (PROXY_HOST != null) {
if (PROXY_USER != null) {
HttpState state = client.getState();
- state.setProxyCredentials(null, new UsernamePasswordCredentials(
+ state.setProxyCredentials(null, null, new UsernamePasswordCredentials(
PROXY_USER, PROXY_PASS));
}
client.getHostConfiguration().setProxy(PROXY_HOST, Integer.parseInt(PROXY_PORT));
1.10 +5 -5 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestMethodsExternalHost.java
Index: TestMethodsExternalHost.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestMethodsExternalHost.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TestMethodsExternalHost.java 7 Feb 2003 04:50:03 -0000 1.9
+++ TestMethodsExternalHost.java 5 Jul 2003 22:31:21 -0000 1.10
@@ -120,7 +120,7 @@
if (PROXY_HOST != null) {
if (PROXY_USER != null) {
HttpState state = client.getState();
- state.setProxyCredentials(null, new UsernamePasswordCredentials(
+ state.setProxyCredentials(null, null, new UsernamePasswordCredentials(
PROXY_USER, PROXY_PASS));
}
client.getHostConfiguration().setProxy(PROXY_HOST, Integer.parseInt(PROXY_PORT));
1.13 +10 -10 jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestWebappBasicAuth.java
Index: TestWebappBasicAuth.java
===================================================================
RCS file: /home/cvs/jakarta-commons/httpclient/src/test/org/apache/commons/httpclient/TestWebappBasicAuth.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TestWebappBasicAuth.java 27 Mar 2003 20:58:28 -0000 1.12
+++ TestWebappBasicAuth.java 5 Jul 2003 22:31:21 -0000 1.13
@@ -109,7 +109,7 @@
public void testSimpleAuthGet() throws Exception {
HttpClient client = createHttpClient();
- client.getState().setCredentials("BasicAuthServlet",new UsernamePasswordCredentials("jakarta","commons"));
+ client.getState().setCredentials("BasicAuthServlet", null, new UsernamePasswordCredentials("jakarta","commons"));
GetMethod method = new GetMethod("/" + getWebappContext() + "/auth/basic");
try {
@@ -137,7 +137,7 @@
public void testSimpleAuthPost() throws Exception {
HttpClient client = createHttpClient();
- client.getState().setCredentials("BasicAuthServlet",new UsernamePasswordCredentials("jakarta","commons"));
+ client.getState().setCredentials("BasicAuthServlet", null, new UsernamePasswordCredentials("jakarta","commons"));
PostMethod method = new PostMethod("/" + getWebappContext() + "/auth/basic");
method.setRequestBody(new NameValuePair[] { new NameValuePair("testing","one") } );
@@ -167,7 +167,7 @@
public void testSimpleAuthPut() throws Exception {
HttpClient client = createHttpClient();
- client.getState().setCredentials("BasicAuthServlet",new UsernamePasswordCredentials("jakarta","commons"));
+ client.getState().setCredentials("BasicAuthServlet", null, new UsernamePasswordCredentials("jakarta","commons"));
PutMethod method = new PutMethod("/" + getWebappContext() + "/auth/basic");
method.setRequestBody("testing one two three");
try {
@@ -207,7 +207,7 @@
assertTrue(method.getResponseBodyAsString().indexOf("<title>BasicAuth Servlet: GET</title>") >= 0);
assertTrue(method.getResponseBodyAsString().indexOf("<p>Not authorized.</p>") >= 0);
- client.getState().setCredentials("BasicAuthServlet",new UsernamePasswordCredentials("jakarta","commons"));
+ client.getState().setCredentials("BasicAuthServlet", null, new UsernamePasswordCredentials("jakarta","commons"));
method.recycle();
method.setPath("/" + getWebappContext() + "/auth/basic");
@@ -236,7 +236,7 @@
assertTrue(method.getResponseBodyAsString().indexOf("<title>BasicAuth Servlet: GET</title>") >= 0);
assertTrue(method.getResponseBodyAsString().indexOf("<p>Not authorized.</p>") >= 0);
- client.getState().setCredentials("BasicAuthServlet",new UsernamePasswordCredentials("bad","creds"));
+ client.getState().setCredentials("BasicAuthServlet", null, new UsernamePasswordCredentials("bad","creds"));
method.recycle();
method.setPath("/" + getWebappContext() + "/auth/basic");
@@ -255,7 +255,7 @@
HttpClient client = new HttpClient();
HttpState state = client.getState();
Credentials cred = new UsernamePasswordCredentials("jakarta", "commons");
- state.setCredentials(null, cred);
+ state.setCredentials(null, null, cred);
HostConfiguration hc = new HostConfiguration();
hc.setHost(getHost(), getPort(), getProtocol());
client.setHostConfiguration(hc);
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org
Re: cvs
commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient
TestAuthenticator.java TestHttpState.java
TestHttps.java TestMethodsExternalHost.java TestWebappBasicAuth.java
Posted by Oleg Kalnichevski <ol...@apache.org>.
Christopher,
I understand your position. The problem of maintaining the compatibility
with 2.0 APIs has been discussed several times on this mailing list, and
if my memory does not fail me, the consensus was that it could not be
maintained in the future versions. The existing architecture cannot
evolve, sadly, it has got to be redesigned so it could be 'evolvable' in
the future. HttpClient is in a dire need of a better design. We have
been very explicit about it.
This said, we will maintain 2.0 branch for those who rely on it, but we
also have obligations to other users as well. Some bug fixes are simply
not possible if existing architecture is to be preserved.
I hope you will be able to see beyond the interests of your own project.
Cheers
Oleg
On Sun, 2003-07-06 at 13:46, Christopher Lenz wrote:
> Oleg,
>
> Oleg Kalnichevski wrote:
> > It was an unfortunate oversight. The method should have been deprecated
> > along with all other methods whose functionality is now provided by
> > CookieSpec classes. I apologise for that.
>
> That's what I thought. Please remember to add the @deprecate tag to the
> 2_0 branch, so that others don't "suffer" from this oversight.
>
> > We will no longer be able to provide API compatibility with 2.0 branch
> > in CVS HEAD. We have to start fixing things that are broken by design
>
> Sigh. I hope you're not serious about this. I understand that you need
> to change stuff, and maybe a lot of stuff. Still, you need to *evolve*
> the API[1], implying that you should maintain API compatibility with the
> 2.0 release.
>
> Now, I can live with deprecated methods being removed inbetween point
> releases (usually they live a bit longer). The methods were deprecated,
> and we're not using them anymore.
>
> I absolutely cannot silently accept this "announcement" that API
> compatibility is not going to be maintained. HttpClient has already been
> forked in the past[2] for this reason. Now that HttpClient is a
> healthier and also pretty successful project, the team should pay utmost
> attention to not breaking its clients. If changes are necessary,
> deprecate first and find a good way to evolve the API without breaking
> it. That can be challenging, but it's usually worth the effort.
>
> > 2.0 is almost done. We foresee only minor documentation changes in the
> > future. The code will not be touched unless something _really_ bad pops
> > up.
> >
> > Please use official 2.0.x builds.
>
> We will continue to use both: the official releases of the 2.0 branch
> (and hopefully soon a 2.0 final), as well as CVS HEAD.
>
> The latter is done because we want to detect potential problems with our
> usage of HttpClient as early as possible. Obviously, that will make it
> easier for us to switch to 2.1 (for example) when it's released, but
> more importantly, we can give feedback to the HttpClient team when stuff
> changes that we're not happy with.
>
> Oh wait, there's a Jakarta project about this:
> http://jakarta.apache.org/gump/
>
> -chris
>
> [1] http://eclipse.org/eclipse/development/java-api-evolution.html
> [2]
> http://cvs.apache.org/viewcvs.cgi/jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/
RE: cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestAuthenticator.java TestHttpState.java TestHttps.java TestMethodsExternalHost.java TestWebappBasicAuth.java
Posted by Vincent Massol <vm...@pivolis.com>.
Thanks Michael for you answer. Cactus is being built using Gump every
day so whenever something breaks in HttpClient, be sure we'll be there
to help prevent any incompatibility :-)
We always try to follow the deprecation hints and upgrade as we go. What
is bad it when it breaks suddenly, which is what we would like to avoid.
This happened yesterday with the parse() method but I understand this
was a mistake and not something wanted... :-)
Thanks
-Vincent
> -----Original Message-----
> From: Michael Becke [mailto:becke@u.washington.edu]
> Sent: 06 July 2003 20:28
> To: Commons HttpClient Project
> Subject: Re: cvs commit: jakarta-
> commons/httpclient/src/test/org/apache/commons/httpclient
> TestAuthenticator.java TestHttpState.java TestHttps.java
> TestMethodsExternalHost.java TestWebappBasicAuth.java
>
> Just a few comments.
>
> The current plans for 2.1 are fairly modest and most of the changes
can
> be made with little or no API modifications. The exceptions are:
>
> Taken from
> <http://cvs.apache.org/viewcvs/jakarta-commons/httpclient/
> RELEASE_PLAN_2_1.txt?rev=1.1&content-type=text/vnd.viewcvs-markup>
>
> - Removal of functions & classes deprecated in 2.0.
>
> This one is obvious and I think we can agree this is okay. The
one
> exception is the oversight in Cookie.parse() but that will be
fixed.
>
> -Better exception handling framework (Bug #19868).
>
> This one is being debated now. I think this change can be done
> without API problems, though that is perhaps not the cleanest option.
>
> - Cross-site redirect fix. Authentication, redirect & retry logic to
be
> moved from HttpMethodBase to HttpClient (Bug #20089, #16729).
>
> This is the big one. This fix is the most requested and the
most
> useful I think. This change does not effect method signatures
but it
> does change current Method behavior.
>
> My feeling is that we should make all possible efforts to keep API
> compatibility. I do not think this is our highest priority though.
> When it comes between adding 2.1 functionality and API compatibility I
> think we should choose 2.1 functionality. I think we need to weigh
the
> added benefit to users of new functionality against the burden of not
> having the functionality because of API compatibility.
>
> Perhaps this debate should occur on a case by case basis. In doing so
> I think it is quite possible we will come up with a solution for each
> case that is satisfactory to both "sides".
>
> Mike
>
> On Sunday, July 6, 2003, at 07:46 AM, Christopher Lenz wrote:
>
> > Oleg,
> >
> > Oleg Kalnichevski wrote:
> >> It was an unfortunate oversight. The method should have been
> >> deprecated
> >> along with all other methods whose functionality is now provided by
> >> CookieSpec classes. I apologise for that.
> >
> > That's what I thought. Please remember to add the @deprecate tag to
> > the 2_0 branch, so that others don't "suffer" from this oversight.
> >
> >> We will no longer be able to provide API compatibility with 2.0
branch
> >> in CVS HEAD. We have to start fixing things that are broken by
design
> >
> > Sigh. I hope you're not serious about this. I understand that you
need
> > to change stuff, and maybe a lot of stuff. Still, you need to
*evolve*
> > the API[1], implying that you should maintain API compatibility with
> > the 2.0 release.
> >
> > Now, I can live with deprecated methods being removed inbetween
point
> > releases (usually they live a bit longer). The methods were
> > deprecated, and we're not using them anymore.
> >
> > I absolutely cannot silently accept this "announcement" that API
> > compatibility is not going to be maintained. HttpClient has already
> > been forked in the past[2] for this reason. Now that HttpClient is a
> > healthier and also pretty successful project, the team should pay
> > utmost attention to not breaking its clients. If changes are
> > necessary, deprecate first and find a good way to evolve the API
> > without breaking it. That can be challenging, but it's usually worth
> > the effort.
> >
> >> 2.0 is almost done. We foresee only minor documentation changes in
the
> >> future. The code will not be touched unless something _really_ bad
> >> pops
> >> up.
> >> Please use official 2.0.x builds.
> >
> > We will continue to use both: the official releases of the 2.0
branch
> > (and hopefully soon a 2.0 final), as well as CVS HEAD.
> >
> > The latter is done because we want to detect potential problems with
> > our usage of HttpClient as early as possible. Obviously, that will
> > make it easier for us to switch to 2.1 (for example) when it's
> > released, but more importantly, we can give feedback to the
HttpClient
> > team when stuff changes that we're not happy with.
> >
> > Oh wait, there's a Jakarta project about this:
> > http://jakarta.apache.org/gump/
> >
> > -chris
> >
> > [1] http://eclipse.org/eclipse/development/java-api-evolution.html
> > [2]
> >
http://cvs.apache.org/viewcvs.cgi/jakarta-slide/src/webdav/client/src/
> > org/apache/commons/httpclient/
> >
> > --
> > Christopher Lenz
> > /=/ cmlenz at gmx.de
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > commons-httpclient-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > commons-httpclient-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-
> unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-
> help@jakarta.apache.org
Re: cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestAuthenticator.java TestHttpState.java TestHttps.java TestMethodsExternalHost.java TestWebappBasicAuth.java
Posted by Michael Becke <be...@u.washington.edu>.
Just a few comments.
The current plans for 2.1 are fairly modest and most of the changes can
be made with little or no API modifications. The exceptions are:
Taken from
<http://cvs.apache.org/viewcvs/jakarta-commons/httpclient/
RELEASE_PLAN_2_1.txt?rev=1.1&content-type=text/vnd.viewcvs-markup>
- Removal of functions & classes deprecated in 2.0.
This one is obvious and I think we can agree this is okay. The one
exception is the oversight in Cookie.parse() but that will be fixed.
-Better exception handling framework (Bug #19868).
This one is being debated now. I think this change can be done
without API problems, though that is perhaps not the cleanest option.
- Cross-site redirect fix. Authentication, redirect & retry logic to be
moved from HttpMethodBase to HttpClient (Bug #20089, #16729).
This is the big one. This fix is the most requested and the most
useful I think. This change does not effect method signatures but it
does change current Method behavior.
My feeling is that we should make all possible efforts to keep API
compatibility. I do not think this is our highest priority though.
When it comes between adding 2.1 functionality and API compatibility I
think we should choose 2.1 functionality. I think we need to weigh the
added benefit to users of new functionality against the burden of not
having the functionality because of API compatibility.
Perhaps this debate should occur on a case by case basis. In doing so
I think it is quite possible we will come up with a solution for each
case that is satisfactory to both "sides".
Mike
On Sunday, July 6, 2003, at 07:46 AM, Christopher Lenz wrote:
> Oleg,
>
> Oleg Kalnichevski wrote:
>> It was an unfortunate oversight. The method should have been
>> deprecated
>> along with all other methods whose functionality is now provided by
>> CookieSpec classes. I apologise for that.
>
> That's what I thought. Please remember to add the @deprecate tag to
> the 2_0 branch, so that others don't "suffer" from this oversight.
>
>> We will no longer be able to provide API compatibility with 2.0 branch
>> in CVS HEAD. We have to start fixing things that are broken by design
>
> Sigh. I hope you're not serious about this. I understand that you need
> to change stuff, and maybe a lot of stuff. Still, you need to *evolve*
> the API[1], implying that you should maintain API compatibility with
> the 2.0 release.
>
> Now, I can live with deprecated methods being removed inbetween point
> releases (usually they live a bit longer). The methods were
> deprecated, and we're not using them anymore.
>
> I absolutely cannot silently accept this "announcement" that API
> compatibility is not going to be maintained. HttpClient has already
> been forked in the past[2] for this reason. Now that HttpClient is a
> healthier and also pretty successful project, the team should pay
> utmost attention to not breaking its clients. If changes are
> necessary, deprecate first and find a good way to evolve the API
> without breaking it. That can be challenging, but it's usually worth
> the effort.
>
>> 2.0 is almost done. We foresee only minor documentation changes in the
>> future. The code will not be touched unless something _really_ bad
>> pops
>> up.
>> Please use official 2.0.x builds.
>
> We will continue to use both: the official releases of the 2.0 branch
> (and hopefully soon a 2.0 final), as well as CVS HEAD.
>
> The latter is done because we want to detect potential problems with
> our usage of HttpClient as early as possible. Obviously, that will
> make it easier for us to switch to 2.1 (for example) when it's
> released, but more importantly, we can give feedback to the HttpClient
> team when stuff changes that we're not happy with.
>
> Oh wait, there's a Jakarta project about this:
> http://jakarta.apache.org/gump/
>
> -chris
>
> [1] http://eclipse.org/eclipse/development/java-api-evolution.html
> [2]
> http://cvs.apache.org/viewcvs.cgi/jakarta-slide/src/webdav/client/src/
> org/apache/commons/httpclient/
>
> --
> Christopher Lenz
> /=/ cmlenz at gmx.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-httpclient-dev-help@jakarta.apache.org
>
RE:
cvscommit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclientTestAuthenticator.java
TestHttpState.javaTestHttps.java TestMethodsExternalHost.java
TestWebappBasicAuth.java
Posted by Oleg Kalnichevski <ol...@apache.org>.
> Hey, we're simply users, not developers of HttpClient! :-)
>
Vincent, what is wrong with trying to influence the course of HttpClient
development when development plans are being publicly discussed, but not
after a decision has been taken? There is nothing that precludes you
from voicing your opinion on issues that are important for you.
> >
> > Please also advice me how to fix these bugs while retaining 2.0 API
> > compatibility:
> >
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20089
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16729
>
> I fear I am not able to help much as I'm not an HttpClient developer and
> I would need to dive in the code to give any help. That said, there are
> always ways to evolve an API by going through a deprecation mechanism.
>
It is not a problem to mark a method as deprecated. The problem is to
keep deprecated stuff fully functional once the overall architecture has
undergone some significant changes. I do not see at as always feasible.
In my humble opinion 2.0 API has been REALLY stretched to its very limit
and have done everything possible within the constraints of the existing
architecture.
Guys, please try to see a bit beyond your own project and your own
interests.
Cheers
Oleg
RE: cvscommit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclientTestAuthenticator.java TestHttpState.javaTestHttps.java TestMethodsExternalHost.java TestWebappBasicAuth.java
Posted by Vincent Massol <vm...@pivolis.com>.
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: 06 July 2003 17:57
> To: Commons HttpClient Project
> Subject: RE: cvscommit: jakarta-
>
commons/httpclient/src/test/org/apache/commons/httpclientTestAuthenticat
or
> .java TestHttpState.javaTestHttps.java TestMethodsExternalHost.java
> TestWebappBasicAuth.java
>
> > Strong +1
> >
> > Please do not break compatibility at once, go through a deprecation
> > mechanism.
> >
> > Thanks
> > -Vincent
> >
>
> Folks, where have you been when the release plan for 2.1 was
discussed?
Hey, we're simply users, not developers of HttpClient! :-)
>
> Please also advice me how to fix these bugs while retaining 2.0 API
> compatibility:
>
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20089
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16729
I fear I am not able to help much as I'm not an HttpClient developer and
I would need to dive in the code to give any help. That said, there are
always ways to evolve an API by going through a deprecation mechanism.
A good read:
http://eclipse.org/eclipse/development/java-api-evolution.html
Thanks
-Vincent
>
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-
> unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-
> help@jakarta.apache.org
RE: cvs
commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient
TestAuthenticator.java TestHttpState.java
TestHttps.java TestMethodsExternalHost.java TestWebappBasicAuth.java
Posted by Oleg Kalnichevski <ol...@apache.org>.
> Strong +1
>
> Please do not break compatibility at once, go through a deprecation
> mechanism.
>
> Thanks
> -Vincent
>
Folks, where have you been when the release plan for 2.1 was discussed?
Please also advice me how to fix these bugs while retaining 2.0 API
compatibility:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20089
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16729
Oleg
RE: cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient TestAuthenticator.java TestHttpState.java TestHttps.java TestMethodsExternalHost.java TestWebappBasicAuth.java
Posted by Vincent Massol <vm...@pivolis.com>.
> -----Original Message-----
> From: Christopher Lenz [mailto:cmlenz@gmx.de]
> Sent: 06 July 2003 13:46
> To: Commons HttpClient Project
> Subject: Re: cvs commit: jakarta-
> commons/httpclient/src/test/org/apache/commons/httpclient
> TestAuthenticator.java TestHttpState.java TestHttps.java
> TestMethodsExternalHost.java TestWebappBasicAuth.java
>
> Oleg,
>
> Oleg Kalnichevski wrote:
> > It was an unfortunate oversight. The method should have been
deprecated
> > along with all other methods whose functionality is now provided by
> > CookieSpec classes. I apologise for that.
>
> That's what I thought. Please remember to add the @deprecate tag to
the
> 2_0 branch, so that others don't "suffer" from this oversight.
>
> > We will no longer be able to provide API compatibility with 2.0
branch
> > in CVS HEAD. We have to start fixing things that are broken by
design
>
> Sigh. I hope you're not serious about this. I understand that you need
> to change stuff, and maybe a lot of stuff. Still, you need to *evolve*
> the API[1], implying that you should maintain API compatibility with
the
> 2.0 release.
>
> Now, I can live with deprecated methods being removed inbetween point
> releases (usually they live a bit longer). The methods were
deprecated,
> and we're not using them anymore.
>
> I absolutely cannot silently accept this "announcement" that API
> compatibility is not going to be maintained. HttpClient has already
been
> forked in the past[2] for this reason. Now that HttpClient is a
> healthier and also pretty successful project, the team should pay
utmost
> attention to not breaking its clients. If changes are necessary,
> deprecate first and find a good way to evolve the API without breaking
> it. That can be challenging, but it's usually worth the effort.
Strong +1
Please do not break compatibility at once, go through a deprecation
mechanism.
Thanks
-Vincent
>
> > 2.0 is almost done. We foresee only minor documentation changes in
the
> > future. The code will not be touched unless something _really_ bad
pops
> > up.
> >
> > Please use official 2.0.x builds.
>
> We will continue to use both: the official releases of the 2.0 branch
> (and hopefully soon a 2.0 final), as well as CVS HEAD.
>
> The latter is done because we want to detect potential problems with
our
> usage of HttpClient as early as possible. Obviously, that will make it
> easier for us to switch to 2.1 (for example) when it's released, but
> more importantly, we can give feedback to the HttpClient team when
stuff
> changes that we're not happy with.
>
> Oh wait, there's a Jakarta project about this:
> http://jakarta.apache.org/gump/
>
> -chris
>
> [1] http://eclipse.org/eclipse/development/java-api-evolution.html
> [2]
> http://cvs.apache.org/viewcvs.cgi/jakarta-
> slide/src/webdav/client/src/org/apache/commons/httpclient/
>
> --
> Christopher Lenz
> /=/ cmlenz at gmx.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-
> unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-
> help@jakarta.apache.org
Re: cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient
TestAuthenticator.java TestHttpState.java TestHttps.java TestMethodsExternalHost.java
TestWebappBasicAuth.java
Posted by Christopher Lenz <cm...@gmx.de>.
Oleg,
Oleg Kalnichevski wrote:
> It was an unfortunate oversight. The method should have been deprecated
> along with all other methods whose functionality is now provided by
> CookieSpec classes. I apologise for that.
That's what I thought. Please remember to add the @deprecate tag to the
2_0 branch, so that others don't "suffer" from this oversight.
> We will no longer be able to provide API compatibility with 2.0 branch
> in CVS HEAD. We have to start fixing things that are broken by design
Sigh. I hope you're not serious about this. I understand that you need
to change stuff, and maybe a lot of stuff. Still, you need to *evolve*
the API[1], implying that you should maintain API compatibility with the
2.0 release.
Now, I can live with deprecated methods being removed inbetween point
releases (usually they live a bit longer). The methods were deprecated,
and we're not using them anymore.
I absolutely cannot silently accept this "announcement" that API
compatibility is not going to be maintained. HttpClient has already been
forked in the past[2] for this reason. Now that HttpClient is a
healthier and also pretty successful project, the team should pay utmost
attention to not breaking its clients. If changes are necessary,
deprecate first and find a good way to evolve the API without breaking
it. That can be challenging, but it's usually worth the effort.
> 2.0 is almost done. We foresee only minor documentation changes in the
> future. The code will not be touched unless something _really_ bad pops
> up.
>
> Please use official 2.0.x builds.
We will continue to use both: the official releases of the 2.0 branch
(and hopefully soon a 2.0 final), as well as CVS HEAD.
The latter is done because we want to detect potential problems with our
usage of HttpClient as early as possible. Obviously, that will make it
easier for us to switch to 2.1 (for example) when it's released, but
more importantly, we can give feedback to the HttpClient team when stuff
changes that we're not happy with.
Oh wait, there's a Jakarta project about this:
http://jakarta.apache.org/gump/
-chris
[1] http://eclipse.org/eclipse/development/java-api-evolution.html
[2]
http://cvs.apache.org/viewcvs.cgi/jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/
--
Christopher Lenz
/=/ cmlenz at gmx.de
Re: cvs commit:
jakarta-commons/httpclient/src/test/org/apache/commons/httpclient
TestAuthenticator.java TestHttpState.java TestHttps.java
TestMethodsExternalHost.java TestWebappBasicAuth.java
Posted by Oleg Kalnichevski <ol...@apache.org>.
Christopher,
It was an unfortunate oversight. The method should have been deprecated
along with all other methods whose functionality is now provided by
CookieSpec classes. I apologise for that.
We will no longer be able to provide API compatibility with 2.0 branch
in CVS HEAD. We have to start fixing things that are broken by design
2.0 is almost done. We foresee only minor documentation changes in the
future. The code will not be touched unless something _really_ bad pops
up.
Please use official 2.0.x builds.
Cheers
Oleg
Re: cvs commit: jakarta-commons/httpclient/src/test/org/apache/commons/httpclient
TestAuthenticator.java TestHttpState.java TestHttps.java TestMethodsExternalHost.java
TestWebappBasicAuth.java
Posted by Christopher Lenz <cm...@gmx.de>.
olegk@apache.org wrote:
> olegk 2003/07/05 15:31:21
>
> Modified: httpclient/src/java/org/apache/commons/httpclient
> Cookie.java HttpClient.java HttpConnection.java
> HttpState.java
> MultiThreadedHttpConnectionManager.java URI.java
> httpclient/src/java/org/apache/commons/httpclient/util
> URIUtil.java
> httpclient/src/test/org/apache/commons/httpclient
> TestAuthenticator.java TestHttpState.java
> TestHttps.java TestMethodsExternalHost.java
> TestWebappBasicAuth.java
> Removed: httpclient/src/java/org/apache/commons/httpclient
> Authenticator.java HttpUrlMethod.java
> RequestOutputStream.java ResponseInputStream.java
> Log:
> Deprecated methods in Cookie, HttpClient, HttpConnection, HttpState, URI, URIUtil classes removed. Deprecated classes Authenticator, HttpUrlMethod, RequestOutputStream, ResponseInputStream removed.
[snip]
> - /**
> - * Parses the Set-Cookie {@link Header} into an array of
> - * <tt>Cookie</tt>s, assuming that the cookies were recieved
> - * on an insecure channel.
> - *
> - * @param domain the domain from which the {@link Header} was received
> - * @param port the port from which the {@link Header} was received
> - * (currently ignored)
> - * @param path the path from which the {@link Header} was received
> - * @param setCookie the <tt>Set-Cookie</tt> {@link Header} received from the
> - * server
> - * @return an array of <tt>Cookie</tt>s parsed from the Set-Cookie {@link
> - * Header}
> - * @throws HttpException if an exception occurs during parsing
> - * @throws IllegalArgumentException if domain or path are null
> - */
> - public static Cookie[] parse(
> - String domain, int port, String path, Header setCookie)
> - throws HttpException, IllegalArgumentException {
> -
> - LOG.trace("enter Cookie.parse(String, int, String, Header)");
> - return Cookie.parse(domain, port, path, false, setCookie);
> - }
This method was *not* deprecated!
http://cvs.apache.org/builds/gump/2003-07-06/jakarta-cactus-framework-12.html
Of course you can still add the @deprecated tag to the 2.0 branch ...
--
Christopher Lenz
/=/ cmlenz at gmx.de