Package org.apache.lucene.tests.mockfile
Class ExtrasFS
- java.lang.Object
- 
- java.nio.file.spi.FileSystemProvider
- 
- org.apache.lucene.tests.mockfile.FilterFileSystemProvider
- 
- org.apache.lucene.tests.mockfile.ExtrasFS
 
 
 
- 
 public class ExtrasFS extends FilterFileSystemProvider Adds extra files/subdirectories when directories are created.Lucene shouldn't care about these, but sometimes operating systems create special files themselves (.DS_Store, thumbs.db, .nfsXXX, ...), so we add them and see what breaks. When a directory is created, sometimes an "extra" file or directory will be included with it (use isExtra(String)to check if it's one of those files).All other filesystem operations are delegated as normal. 
- 
- 
Field Summary- 
Fields inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProviderdelegate, fileSystem, scheme
 
- 
 - 
Constructor SummaryConstructors Constructor Description ExtrasFS(FileSystem delegate, boolean active, boolean createDirectory)Create a new instance, wrappingdelegate.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDirectory(Path dir, FileAttribute<?>... attrs)static booleanisExtra(String fileName)- 
Methods inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvidercheckAccess, copy, createLink, createSymbolicLink, delete, deleteIfExists, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, move, newAsynchronousFileChannel, newByteChannel, newDirectoryStream, newFileChannel, newFileSystem, newFileSystem, newInputStream, newOutputStream, onClose, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toString, wrapPath
 - 
Methods inherited from class java.nio.file.spi.FileSystemProviderinstalledProviders
 
- 
 
- 
- 
- 
Constructor Detail- 
ExtrasFSpublic ExtrasFS(FileSystem delegate, boolean active, boolean createDirectory) Create a new instance, wrappingdelegate.- Parameters:
- active-- trueif we should create extra files
- createDirectory-- trueif we should create directories instead of files. Ignored if- activeis- false.
 
 
- 
 - 
Method Detail- 
createDirectorypublic void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException - Overrides:
- createDirectoryin class- FilterFileSystemProvider
- Throws:
- IOException
 
 - 
isExtrapublic static boolean isExtra(String fileName) - Returns:
- Return true if fileNameis one of the extra files added by this class.
 
 
- 
 
-