public class LeakFS extends HandleTrackingFS
When FileSystem.close()
is called, this class will throw
an exception if any file handles are still open.
delegate, fileSystem, scheme
Constructor and Description |
---|
LeakFS(FileSystem delegate)
Create a new instance, tracking file handle leaks for the
specified delegate filesystem.
|
Modifier and Type | Method and Description |
---|---|
void |
onClose()
Override to trigger some behavior when the filesystem is closed.
|
protected void |
onClose(Path path,
Object stream)
Called when
path is closed via stream . |
protected void |
onOpen(Path path,
Object stream)
Called when
path is opened via stream . |
newAsynchronousFileChannel, newByteChannel, newDirectoryStream, newFileChannel, newInputStream, newOutputStream
checkAccess, copy, createDirectory, createLink, createSymbolicLink, delete, deleteIfExists, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, move, newFileSystem, newFileSystem, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toString
installedProviders
public LeakFS(FileSystem delegate)
delegate
- delegate filesystem to wrap.protected void onOpen(Path path, Object stream)
HandleTrackingFS
path
is opened via stream
.onOpen
in class HandleTrackingFS
path
- Path that was openedstream
- Stream or Channel opened against the path.protected void onClose(Path path, Object stream)
HandleTrackingFS
path
is closed via stream
.onClose
in class HandleTrackingFS
path
- Path that was closedstream
- Stream or Channel closed against the path.public void onClose()
FilterFileSystemProvider
This is always called for each FilterFileSystemProvider in the chain.
onClose
in class FilterFileSystemProvider
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.