Code example for File

Methods: deleteOnExit

0
    private class SimpleTempFile implements TempFile { 
        private File file = null;
 
        private SimpleTempFile(File file) {
            this.file = file;
            this.file.deleteOnExit();
        } 
 
        /** 
         * @see org.apache.james.mime4j.util.TempFile#getInputStream() 
         */ 
        public InputStream getInputStream() throws IOException {
            return new BufferedInputStream(new FileInputStream(file));
        } 
 
        /** 
         * @see org.apache.james.mime4j.util.TempFile#getOutputStream() 
         */ 
        public OutputStream getOutputStream() throws IOException {
            return new BufferedOutputStream(new FileOutputStream(file));
        }