morgand 01/05/02 14:30:54
Modified: httpclient/src/java/org/apache/commons/httpclient
HttpClient.java
Log:
deprecated startSession(), HttpClient(URL) and
HttpClient(URL, String, String). Added HttpClient(String, String)
Revision Changes Path
1.5 +57 -6
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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HttpClient.java 2001/05/01 06:49:46 1.4
+++ HttpClient.java 2001/05/02 21:30:48 1.5
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
1.4 2001/05/01 06:49:46 remm Exp $
- * $Revision: 1.4 $
- * $Date: 2001/05/01 06:49:46 $
+ * $Header:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
1.5 2001/05/02 21:30:48 morgand Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/05/02 21:30:48 $
*
* ====================================================================
*
@@ -109,16 +109,58 @@
// ----------------------------------------------------------- Constructors
+ /**
+ * One of two preferred constructors for HttpClient. Call
+ * {@link #startSession(URL)} or
+ * {@link #startSession(String, int)} to begin a
+ * session.
+ *
+ * <b>Note:</b> The HttpClient constructors used to
+ * implicitly start a session. That behavior has been
+ * removed.
+ */
public HttpClient() {
- startSession();
+ //startSession();
}
+ /**
+ * One of two preferred constructors for HttpClient. Call
+ * {@link #startSession(URL)} or
+ * {@link #startSession(String, int)} to begin a
+ * session.
+ *
+ * <b>Note:</b> The HttpClient constructors used to
+ * implicitly start a session. That behavior has been
+ * removed.
+ * @param user
+ * @param password
+ */
+ public HttpClient(String user, String password) {
+ setCredentials(new Credentials(user, password));
+ }
+ /**
+ * <b>Note:</b> The HttpClient constructor used to
+ * implicitly start a session. That behavior has been
+ * removed.
+ *
+ * @param url
+ * @deprecated This constructor was considered misleading in
+ * conjunction with the {@link #startSession()}
+ */
public HttpClient(URL url) {
- startSession(url);
+ //startSession(url);
}
+ /**
+ *
+ * @param url
+ * @param user
+ * @param password
+ * @deprecated This constructor was considered misleading in
+ * conjunction with the {@link #startSession()}
+ */
public HttpClient(URL url, String user, String password) {
this(url);
setCredentials(new Credentials(user, password));
@@ -545,6 +587,10 @@
/**
* Start a session.
+ *
+ * @deprecated This method opens a connection to
+ * localhost:80. It will be removed in a future release
+ * to make usage more clear.
*/
public void startSession() {
@@ -571,7 +617,12 @@
}
/**
- * Start a session.
+ * Start a session. When starting a session, only the
+ * hostname and port are considered. The path must still
+ * be set when constructing an HttpMethod (GetMethod,
+ * PutMethod, etc.)
+ *
+ * @param url URL object containing the target hostname and port
*/
public void startSession(URL url) {
startSession(url.getHost(), url.getPort() == -1 ? 80 : url.getPort());