Package org.dspace.storage.bitstore
Class DeleteOnCloseFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FileInputStream
-
- org.dspace.storage.bitstore.DeleteOnCloseFileInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class DeleteOnCloseFileInputStream extends FileInputStream
When inputstream closes, then delete the file http://stackoverflow.com/a/4694155/368581
-
-
Constructor Summary
Constructors Constructor Description DeleteOnCloseFileInputStream(File file)DeleteOnCloseFileInputStream(String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()-
Methods inherited from class java.io.FileInputStream
available, finalize, getChannel, getFD, read, read, read, skip
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, transferTo
-
-
-
-
Constructor Detail
-
DeleteOnCloseFileInputStream
public DeleteOnCloseFileInputStream(String fileName) throws FileNotFoundException
- Throws:
FileNotFoundException
-
DeleteOnCloseFileInputStream
public DeleteOnCloseFileInputStream(File file) throws FileNotFoundException
- Throws:
FileNotFoundException
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFileInputStream- Throws:
IOException
-
-