commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r209275 - in /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav: WebDavFileSystem.java WebdavConnectionManager.java
Date Tue, 05 Jul 2005 14:14:24 GMT
Author: imario
Date: Tue Jul  5 07:14:22 2005
New Revision: 209275

URL: http://svn.apache.org/viewcvs?rev=209275&view=rev
Log:
prepare for closeHttpClientConnection per Thread

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebDavFileSystem.java
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebdavConnectionManager.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebDavFileSystem.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebDavFileSystem.java?rev=209275&r1=209274&r2=209275&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebDavFileSystem.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebDavFileSystem.java
Tue Jul  5 07:14:22 2005
@@ -16,6 +16,7 @@
 package org.apache.commons.vfs.provider.webdav;
 
 import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpConnectionManager;
 import org.apache.commons.vfs.FileName;
 import org.apache.commons.vfs.FileObject;
 import org.apache.commons.vfs.FileSystem;
@@ -59,6 +60,15 @@
     protected HttpClient getClient() throws FileSystemException
     {
         return client;
+    }
+
+    protected void closeHttpClientConnection() throws FileSystemException
+    {
+        HttpConnectionManager mgr = getClient().getHttpConnectionManager();
+        if (mgr instanceof WebdavConnectionManager)
+        {
+            ((WebdavConnectionManager) mgr).releaseLocalConnection();
+        }
     }
 
     /**

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebdavConnectionManager.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebdavConnectionManager.java?rev=209275&r1=209274&r2=209275&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebdavConnectionManager.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/webdav/WebdavConnectionManager.java
Tue Jul  5 07:14:22 2005
@@ -66,6 +66,17 @@
      */
     private HttpConnectionManagerParams params = new HttpConnectionManagerParams();
 
+    /**
+     * release the connection of the current thread
+     */
+    public void releaseLocalConnection()
+    {
+        if (getLocalHttpConnection() != null)
+        {
+            releaseConnection(getLocalHttpConnection());
+        }
+    }
+
     private static class Entry
     {
         /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message