Author: antoine
Date: Sat Oct 28 16:19:42 2006
New Revision: 468784

URL: http://svn.apache.org/viewvc?view=rev&rev=468784
Log:
Close input stream in putMethod(String, File)
Bugzilla 40835.
Suggested by Michael N Christoff

Modified:
    
jakarta/slide/trunk/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java

Modified: 
jakarta/slide/trunk/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java
URL: 
http://svn.apache.org/viewvc/jakarta/slide/trunk/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java?view=diff&rev=468784&r1=468783&r2=468784
==============================================================================
--- 
jakarta/slide/trunk/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java
 (original)
+++ 
jakarta/slide/trunk/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java
 Sat Oct 28 16:19:42 2006
@@ -2823,12 +2823,15 @@
         method.setRequestContentLength(fileLength <= Integer.MAX_VALUE
                                        ? (int) fileLength
                                        : PutMethod.CONTENT_LENGTH_CHUNKED);
-        method.setRequestBody(new FileInputStream(file));
+        FileInputStream fis = new FileInputStream(file);
+        method.setRequestBody(fis);
         generateTransactionHeader(method);
         generateAdditionalHeaders(method);
         int statusCode = client.executeMethod(method);
 
         setStatusCode(statusCode);
+
+        fis.close();  // <--- simple update to code
         return (statusCode >= 200 && statusCode < 300) ? true : false;
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to