Package com.illumon.iris.db.util.file
Class FileHandleAccessor
java.lang.Object
com.illumon.iris.db.util.file.FileHandleAccessor
- Direct Known Subclasses:
LocalFileAccessor,TrackedSeekableByteChannel
Base class for accessors that wrap a
FileHandle with support for interruption and asynchronous close.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFileHandleAccessor(FileHandleFactory.FileToHandleFunction fileHandleCreator, File file) Create an accessor that gets handles forfilefromfileHandleCreator. -
Method Summary
Modifier and TypeMethodDescriptionprotected final FileHandlerefreshFileHandle(FileHandle previousLocalHandle) Replace the file handle with a new one if the closed handle passed in is still current, and return the (possibly changed) current value.
-
Field Details
-
file
-
fileHandle
-
-
Constructor Details
-
FileHandleAccessor
protected FileHandleAccessor(@NotNull FileHandleFactory.FileToHandleFunction fileHandleCreator, @NotNull File file) Create an accessor that gets handles forfilefromfileHandleCreator.- Parameters:
fileHandleCreator- The function used to make file handlesfile- The abstract path name to access
-
-
Method Details
-
refreshFileHandle
Replace the file handle with a new one if the closed handle passed in is still current, and return the (possibly changed) current value.- Parameters:
previousLocalHandle- The closed handle that calling code would like to replace- Returns:
- The current file handle, possibly newly created
-