Class FileHandleAccessor

java.lang.Object
io.deephaven.engine.util.file.FileHandleAccessor
Direct Known Subclasses:
TrackedSeekableByteChannel

public abstract class FileHandleAccessor extends Object
Base class for accessors that wrap a FileHandle with support for interruption and asynchronous close.
  • Field Details

    • file

      protected final File file
    • fileHandle

      protected volatile FileHandle fileHandle
  • Constructor Details

    • FileHandleAccessor

      protected FileHandleAccessor(@NotNull FileHandleFactory.FileToHandleFunction fileHandleCreator, @NotNull @NotNull File file)
      Create an accessor that gets handles for file from fileHandleCreator.
      Parameters:
      fileHandleCreator - The function used to make file handles
      file - The abstract path name to access
  • Method Details

    • refreshFileHandle

      protected final FileHandle refreshFileHandle(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.
      Parameters:
      previousLocalHandle - The closed handle that calling code would like to replace
      Returns:
      The current file handle, possibly newly created
    • toString

      public final String toString()
      Overrides:
      toString in class Object