Package org.nuxeo.ecm.core.api
Class CloseableFile
- java.lang.Object
-
- org.nuxeo.ecm.core.api.CloseableFile
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class CloseableFile extends Object implements Closeable
A wrapper for aFile
, which must be closed when done with it in order to release resources.- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description boolean
deleteOnClose
File
file
-
Constructor Summary
Constructors Constructor Description CloseableFile(File file, boolean deleteOnClose)
-
-
-
Field Detail
-
file
public final File file
-
deleteOnClose
public final boolean deleteOnClose
-
-
Constructor Detail
-
CloseableFile
public CloseableFile(File file, boolean deleteOnClose)
-
-
Method Detail
-
getFile
public File getFile()
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-