Patch attached to this email, also added it to bugzilla.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38060

Michael

On Thursday 22 December 2005 23:51, Michael Wechner wrote:
> Michael Ralston wrote:
> >I sent a patch to the list to fix this on the 11th of October. It was a
> >DocumentParser not closing a file when it was finished with it, hence the
> >file was locked and could not be deleted.
>
> right, now I remember. Did anyone actually apply that patch.
> Could you resend your patch resp. attach it to Bugzilla?
>
> Michi
>
diff -Nwurd apache-lenya-1.2.4-orig/src/java/org/apache/lenya/cms/publication/AbstractPublication.java apache-lenya-1.2.4-src/src/java/org/apache/lenya/cms/publication/AbstractPublication.java
--- apache-lenya-1.2.4-orig/src/java/org/apache/lenya/cms/publication/AbstractPublication.java	2005-06-26 10:52:32.000000000 +1000
+++ apache-lenya-1.2.4-src/src/java/org/apache/lenya/cms/publication/AbstractPublication.java	2005-10-11 17:35:22.268846832 +1000
@@ -530,8 +530,8 @@
         if (!document.exists()) {
             throw new PublicationException("Document [" + document + "] does not exist!");
         }
-        deleteFromSiteStructure(document);
         deleteDocumentSource(document);
+        deleteFromSiteStructure(document);
     }
 
     /**
diff -Nwurd apache-lenya-1.2.4-orig/src/java/org/apache/lenya/xml/DocumentHelper.java apache-lenya-1.2.4-src/src/java/org/apache/lenya/xml/DocumentHelper.java
--- apache-lenya-1.2.4-orig/src/java/org/apache/lenya/xml/DocumentHelper.java	2005-06-26 10:52:33.000000000 +1000
+++ apache-lenya-1.2.4-src/src/java/org/apache/lenya/xml/DocumentHelper.java	2005-10-11 17:35:32.884233048 +1000
@@ -20,6 +20,7 @@
 package org.apache.lenya.xml;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Writer;
@@ -47,6 +48,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.Text;
+import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
 
@@ -115,8 +117,10 @@
      */
     public static Document readDocument(File file)
         throws ParserConfigurationException, SAXException, IOException {
-        DocumentBuilder builder = createBuilder();
-        return builder.parse(file);
+        FileInputStream inStream=new FileInputStream(file);
+        Document result=readDocument(inStream);
+        inStream.close();
+        return result;
     }
 
     /**


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

Reply via email to