Package org.apache.lucene.mockfile
Class VirusCheckingFS
- java.lang.Object
-
- java.nio.file.spi.FileSystemProvider
-
- org.apache.lucene.mockfile.FilterFileSystemProvider
-
- org.apache.lucene.mockfile.VirusCheckingFS
-
public class VirusCheckingFS extends FilterFileSystemProvider
Acts like a virus checker on Windows, where random programs may open the files you just wrote in an unfriendly way preventing deletion (e.g. not passing FILE_SHARE_DELETE) or renaming or overwriting etc. This is more evil than WindowsFS which just prevents deletion of files you still old open.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.mockfile.FilterFileSystemProvider
delegate, fileSystem, scheme
-
-
Constructor Summary
Constructors Constructor Description VirusCheckingFS(FileSystem delegate, long salt)
Create a new instance, wrappingdelegate
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(Path path)
void
disable()
void
enable()
boolean
isEnabled()
-
Methods inherited from class org.apache.lucene.mockfile.FilterFileSystemProvider
checkAccess, copy, createDirectory, createLink, createSymbolicLink, deleteIfExists, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, move, newAsynchronousFileChannel, newByteChannel, newDirectoryStream, newFileChannel, newFileSystem, newFileSystem, newInputStream, newOutputStream, onClose, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toString
-
Methods inherited from class java.nio.file.spi.FileSystemProvider
installedProviders
-
-
-
-
Constructor Detail
-
VirusCheckingFS
public VirusCheckingFS(FileSystem delegate, long salt)
Create a new instance, wrappingdelegate
.
-
-
Method Detail
-
enable
public void enable()
-
isEnabled
public boolean isEnabled()
-
disable
public void disable()
-
delete
public void delete(Path path) throws IOException
- Overrides:
delete
in classFilterFileSystemProvider
- Throws:
IOException
-
-