Module methanol.testing
Class LeakDetectingFileSystem
java.lang.Object
java.nio.file.FileSystem
com.github.mizosoft.methanol.testing.file.LeakDetectingFileSystem
- All Implemented Interfaces:
ForwardingObject<FileSystem>
,Closeable
,AutoCloseable
A
ForwardingFileSystem
that detects unclosed resources when closed. Tracked resources are
instances of FileChannel
, AsynchronousFileChannel
and DirectoryStream
. An
IllegalStateException
is thrown when at least one of such resources isn't closed prior to
closing this file system.-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
delegate()
getPathMatcher
(String syntaxAndPattern) boolean
isOpen()
boolean
com.github.mizosoft.methanol.testing.file.FileSystemProviderWrapper
provider()
static LeakDetectingFileSystem
wrap
(FileSystem delegate)
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
wrap
-
provider
public com.github.mizosoft.methanol.testing.file.FileSystemProviderWrapper provider() -
getRootDirectories
-
getPath
-
delegate
- Specified by:
delegate
in interfaceForwardingObject<FileSystem>
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in classFileSystem
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in classFileSystem
-
getSeparator
- Specified by:
getSeparator
in classFileSystem
-
getFileStores
- Specified by:
getFileStores
in classFileSystem
-
supportedFileAttributeViews
- Specified by:
supportedFileAttributeViews
in classFileSystem
-
getPathMatcher
- Specified by:
getPathMatcher
in classFileSystem
-
getUserPrincipalLookupService
- Specified by:
getUserPrincipalLookupService
in classFileSystem
-
newWatchService
- Specified by:
newWatchService
in classFileSystem
- Throws:
IOException
-