DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40202>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

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





------- Additional Comments From [EMAIL PROTECTED]  2007-06-04 09:26 -------
The problem is that there is no reference on the temporary file.

To solve the problem, I made a TempFileInputStream (extending FileInputStream)
that delete the file on fileinputStream close method.


The inner class :

    public class TempFileInputStream extends FileInputStream {

        protected File tmpFile = null;

        public TempFileInputStream (File file) throws FileNotFoundException {
                super(file);
                this.tmpFile = file;
        }
        
        public void close () {
                        try {
                                super.close();
                                tmpFile.delete();
                        } catch (IOException e) {
                                e.printStackTrace();
                        }
                
        }
    }

The modification in NodeRevisionContent

            long length = FileHelper.globalBufferCopy(is, os);
---            InputStream bis = new BufferedInputStream(new
FileInputStream(buffer));
---            setContent(bis);
+++            setContent(new TempFileInputStream(buffer));

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to