Class HandleLimitFS


  • public class HandleLimitFS
    extends HandleTrackingFS
    FileSystem that throws exception if file handles in use exceeds a specified limit
    • Constructor Detail

      • HandleLimitFS

        public HandleLimitFS​(FileSystem delegate,
                             int limit)
        Create a new instance, limiting the maximum number of open files to limit
        Parameters:
        delegate - delegate filesystem to wrap.
        limit - maximum number of open files.
    • Method Detail

      • onOpen

        protected void onOpen​(Path path,
                              Object stream)
                       throws IOException
        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.
        Throws:
        IOException - if an I/O error occurs.
      • onClose

        protected void onClose​(Path path,
                               Object stream)
                        throws IOException
        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.
        Throws:
        IOException - if an I/O error occurs.