Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 77693

Summary: ResourceHandle.getContent does not close response when HTTP error 404 occurs
Product: [Eclipse Project] Platform Reporter: Michal Dobisek <dobisekm>
Component: WebDAVAssignee: Platform-WebDAV-Inbox <platform-webdav-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: ondrej.chylik
Version: 3.0Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michal Dobisek CLA 2004-11-03 12:06:01 EST
The getContent method closes the response only when IOException occurs, but 
when the WebDAVException is thrown by examineReposnse (e.g. for err404), then 
the response remains open.

This patch fixes the bug:

Index: org/eclipse/webdav/client/AbstractResourceHandle.java
===================================================================
RCS 
file: /home/eclipse/org.eclipse.webdav/src/client/org/eclipse/webdav/client/Abst
ractResourceHandle.java,v
retrieving revision 1.17
diff -u -r1.17 AbstractResourceHandle.java
--- org/eclipse/webdav/client/AbstractResourceHandle.java	17 Apr 2004 
21:12:07 -0000	1.17
+++ org/eclipse/webdav/client/AbstractResourceHandle.java	3 Nov 2004 
16:38:35 -0000
@@ -418,7 +418,10 @@
 		} catch (IOException e) {
 			closeResponse(response);
 			throw new SystemException(e);
-		}
+		} catch (DAVException e) {
+            closeResponse(response);
+            throw e;
+        }
 		return new ResponseInputStream(response);
 	}
Comment 1 DJ Houghton CLA 2007-06-20 13:53:09 EDT
This component is no longer being actively developed. We encourage users to investigate the capabilities of the Eclipse Web Tools Project.