Package com.illumon.iris.db.util.file
Class FileHandleAccessor
java.lang.Object
com.illumon.iris.db.util.file.FileHandleAccessor
- Direct Known Subclasses:
LocalFileAccessor,TrackedSeekableByteChannel
public abstract class FileHandleAccessor extends Object
Base class for accessors that wrap a
FileHandle with support for interruption and asynchronous close.-
Field Summary
Fields Modifier and Type Field Description protected Filefileprotected FileHandlefileHandle -
Constructor Summary
Constructors Modifier Constructor Description protectedFileHandleAccessor(FileHandleFactory.FileToHandleFunction fileHandleCreator, File file)Create an accessor that gets handles forfilefromfileHandleCreator. -
Method Summary
Modifier and Type Method Description protected 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
-
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
-