Package org.apache.lucene.tests.mockfile
Class VerboseFS
- java.lang.Object
-
- java.nio.file.spi.FileSystemProvider
-
- org.apache.lucene.tests.mockfile.FilterFileSystemProvider
-
- org.apache.lucene.tests.mockfile.VerboseFS
-
public class VerboseFS extends FilterFileSystemProvider
FileSystem that records all major destructive filesystem activities.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvider
delegate, fileSystem, scheme
-
-
Constructor Summary
Constructors Constructor Description VerboseFS(FileSystem delegate, InfoStream infoStream)Create a new instance, recording major filesystem write activities (create, delete, etc) to the specifiedInfoStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopy(Path source, Path target, CopyOption... options)voidcreateDirectory(Path dir, FileAttribute<?>... attrs)voidcreateLink(Path link, Path existing)voidcreateSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)voiddelete(Path path)booleandeleteIfExists(Path path)voidmove(Path source, Path target, CopyOption... options)AsynchronousFileChannelnewAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)SeekableByteChannelnewByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)FileChannelnewFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)OutputStreamnewOutputStream(Path path, OpenOption... options)voidsetAttribute(Path path, String attribute, Object value, LinkOption... options)-
Methods inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvider
checkAccess, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, newDirectoryStream, newFileSystem, newFileSystem, newInputStream, onClose, readAttributes, readAttributes, readSymbolicLink, toDelegate, toString, wrapPath
-
Methods inherited from class java.nio.file.spi.FileSystemProvider
installedProviders
-
-
-
-
Constructor Detail
-
VerboseFS
public VerboseFS(FileSystem delegate, InfoStream infoStream)
Create a new instance, recording major filesystem write activities (create, delete, etc) to the specifiedInfoStream.- Parameters:
delegate- delegate filesystem to wrap.infoStream- infoStream to send messages to. The component for messages is named "FS".
-
-
Method Detail
-
createDirectory
public void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException
- Overrides:
createDirectoryin classFilterFileSystemProvider- Throws:
IOException
-
delete
public void delete(Path path) throws IOException
- Overrides:
deletein classFilterFileSystemProvider- Throws:
IOException
-
copy
public void copy(Path source, Path target, CopyOption... options) throws IOException
- Overrides:
copyin classFilterFileSystemProvider- Throws:
IOException
-
move
public void move(Path source, Path target, CopyOption... options) throws IOException
- Overrides:
movein classFilterFileSystemProvider- Throws:
IOException
-
setAttribute
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException
- Overrides:
setAttributein classFilterFileSystemProvider- Throws:
IOException
-
newOutputStream
public OutputStream newOutputStream(Path path, OpenOption... options) throws IOException
- Overrides:
newOutputStreamin classFilterFileSystemProvider- Throws:
IOException
-
newFileChannel
public FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
- Overrides:
newFileChannelin classFilterFileSystemProvider- Throws:
IOException
-
newAsynchronousFileChannel
public AsynchronousFileChannel newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) throws IOException
- Overrides:
newAsynchronousFileChannelin classFilterFileSystemProvider- Throws:
IOException
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
- Overrides:
newByteChannelin classFilterFileSystemProvider- Throws:
IOException
-
createSymbolicLink
public void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException
- Overrides:
createSymbolicLinkin classFilterFileSystemProvider- Throws:
IOException
-
createLink
public void createLink(Path link, Path existing) throws IOException
- Overrides:
createLinkin classFilterFileSystemProvider- Throws:
IOException
-
deleteIfExists
public boolean deleteIfExists(Path path) throws IOException
- Overrides:
deleteIfExistsin classFilterFileSystemProvider- Throws:
IOException
-
-