Index: java/org/apache/catalina/servlets/WebdavServlet.java =================================================================== --- java/org/apache/catalina/servlets/WebdavServlet.java (revision 1754440) +++ java/org/apache/catalina/servlets/WebdavServlet.java (working copy) @@ -28,6 +28,7 @@ import java.util.Stack; import java.util.TimeZone; import java.util.Vector; +import java.io.InputStream; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; @@ -1633,7 +1634,8 @@ * @param dest Destination path */ private boolean copyResource(Hashtable errorList, - String source, String dest) { + String source, String dest) + throws IOException { if (debug > 1) log("Copy: " + source + " To: " + dest); @@ -1676,12 +1678,13 @@ } } } - if (!resources.write(dest, sourceResource.getInputStream(), - false)) { + InputStream sourceInputStream = sourceResource.getInputStream(); + if (!resources.write(dest, sourceInputStream, false)) { errorList.put(source, Integer.valueOf(WebdavStatus.SC_INTERNAL_SERVER_ERROR)); return false; } + sourceInputStream.close(); } else { errorList.put(source, Integer.valueOf(WebdavStatus.SC_INTERNAL_SERVER_ERROR));