Class LeakFS


public class LeakFS extends HandleTrackingFS
FileSystem that tracks open handles.

When FileSystem.close() is called, this class will throw an exception if any file handles are still open.

  • Constructor Details

    • LeakFS

      public LeakFS(FileSystem delegate)
      Create a new instance, tracking file handle leaks for the specified delegate filesystem.
      Parameters:
      delegate - delegate filesystem to wrap.
  • Method Details

    • onOpen

      protected void onOpen(Path path, Object stream)
      Description copied from class: HandleTrackingFS
      Called when path is opened via stream.
      Specified by:
      onOpen in class HandleTrackingFS
      Parameters:
      path - Path that was opened
      stream - Stream or Channel opened against the path.
    • onClose

      protected void onClose(Path path, Object stream)
      Description copied from class: HandleTrackingFS
      Called when path is closed via stream.
      Specified by:
      onClose in class HandleTrackingFS
      Parameters:
      path - Path that was closed
      stream - Stream or Channel closed against the path.
    • onClose

      public void onClose()
      Description copied from class: FilterFileSystemProvider
      Override to trigger some behavior when the filesystem is closed.

      This is always called for each FilterFileSystemProvider in the chain.

      Overrides:
      onClose in class FilterFileSystemProvider