remm 01/07/23 17:07:08
Modified: src/webdav/client/src/org/apache/webdav/lib
WebdavSession.java
Log:
- Close session wasn't correctly setting the client to null.
- Deprecate closeSession(client), as the parameter is now useless.
Revision Changes Path
1.15 +21 -9
jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavSession.java
Index: WebdavSession.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavSession.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- WebdavSession.java 2001/07/22 16:55:45 1.14
+++ WebdavSession.java 2001/07/24 00:07:08 1.15
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavSession.java,v
1.14 2001/07/22 16:55:45 remm Exp $
- * $Revision: 1.14 $
- * $Date: 2001/07/22 16:55:45 $
+ * $Header:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavSession.java,v
1.15 2001/07/24 00:07:08 remm Exp $
+ * $Revision: 1.15 $
+ * $Date: 2001/07/24 00:07:08 $
*
* ====================================================================
*
@@ -167,8 +167,7 @@
* @return An instance of <code>HttpClient</code>.
* @exception IOException
*/
- public synchronized HttpClient getSessionInstance(HttpURL httpURL,
- boolean reset)
+ public HttpClient getSessionInstance(HttpURL httpURL, boolean reset)
throws IOException {
String authority = httpURL.getAuthority();
@@ -176,6 +175,7 @@
client = null;
if (client == null) {
client = new HttpClient();
+ client.setDebug(debug);
// Set a state which allows lock tracking
client.setState(new WebdavState());
client.startSession(httpURL.getHost(), httpURL.getPort());
@@ -186,7 +186,6 @@
}
client.setConnectionInterceptor(this);
}
- client.setDebug(debug);
return client;
}
@@ -198,12 +197,25 @@
* @param client The HttpClient instance.
* @exception IOException Error in closing socket.
*/
- public synchronized void closeSession(HttpClient client)
+ public void closeSession()
throws IOException {
- client.endSession();
+ this.client.endSession();
// Remove the progress listener.
// webdavClient.getProgressUtil().addProgressListener(this);
- client = null;
+ this.client = null;
+ }
+
+
+ /**
+ * Close an session and delete the connection information.
+ *
+ * @param client The HttpClient instance.
+ * @exception IOException Error in closing socket.
+ * @deprecated Replaced by closeSession()
+ */
+ public synchronized void closeSession(HttpClient client)
+ throws IOException {
+ closeSession();
}