Class JimfsFileSystemProvider
java.lang.Object
java.nio.file.spi.FileSystemProvider
com.google.common.jimfs.JimfsFileSystemProvider
FileSystemProvider implementation for Jimfs. This provider implements the actual file
system operations but does not handle creation, caching or lookup of file systems. See SystemJimfsFileSystemProvider, which is the META-INF/services/ entry for Jimfs, for
those operations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final JimfsFileSystemProviderprivate static final FileAttribute<?>[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAccess(Path path, AccessMode... modes) private static JimfsPathprivate voidcopy(Path source, Path target, com.google.common.collect.ImmutableSet<CopyOption> options, boolean move) voidcopy(Path source, Path target, CopyOption... options) voidcreateDirectory(Path dir, FileAttribute<?>... attrs) voidcreateLink(Path link, Path existing) voidcreateSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) voidprivate static FileSystemViewgetDefaultView(JimfsPath path) Returns the default file system view for the given path.<V extends FileAttributeView>
@Nullable VgetFileAttributeView(Path path, Class<V> type, LinkOption... options) getFileStore(Path path) getFileSystem(URI uri) private static JimfsFileSystemgetFileSystem(Path path) Gets the file system for the given path.(package private) static JimfsFileSystemProviderinstance()Returns the singleton instance of this provider.booleanbooleanisSameFile(Path path, Path path2) voidmove(Path source, Path target, CopyOption... options) newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, @Nullable ExecutorService executor, FileAttribute<?>... attrs) newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newFileSystem(URI uri, Map<String, ?> env) newFileSystem(Path path, Map<String, ?> env) newInputStream(Path path, OpenOption... options) private JimfsFileChannelnewJimfsFileChannel(JimfsPath path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newOutputStream(Path path, OpenOption... options) <A extends BasicFileAttributes>
AreadAttributes(Path path, Class<A> type, LinkOption... options) readAttributes(Path path, String attributes, LinkOption... options) readSymbolicLink(Path link) voidsetAttribute(Path path, String attribute, Object value, LinkOption... options) Methods inherited from class FileSystemProvider
deleteIfExists, exists, installedProviders, readAttributesIfExists
-
Field Details
-
INSTANCE
-
NO_ATTRS
-
-
Constructor Details
-
JimfsFileSystemProvider
JimfsFileSystemProvider()
-
-
Method Details
-
instance
Returns the singleton instance of this provider. -
getScheme
- Specified by:
getSchemein classFileSystemProvider
-
newFileSystem
- Specified by:
newFileSystemin classFileSystemProvider- Throws:
IOException
-
newFileSystem
- Overrides:
newFileSystemin classFileSystemProvider- Throws:
IOException
-
getFileSystem
- Specified by:
getFileSystemin classFileSystemProvider
-
getFileSystem
Gets the file system for the given path. -
getPath
- Specified by:
getPathin classFileSystemProvider
-
checkPath
-
getDefaultView
Returns the default file system view for the given path. -
newFileChannel
public FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Overrides:
newFileChannelin classFileSystemProvider- Throws:
IOException
-
newJimfsFileChannel
private JimfsFileChannel newJimfsFileChannel(JimfsPath path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Throws:
IOException
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Specified by:
newByteChannelin classFileSystemProvider- Throws:
IOException
-
newAsynchronousFileChannel
public AsynchronousFileChannel newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, @Nullable ExecutorService executor, FileAttribute<?>... attrs) throws IOException - Overrides:
newAsynchronousFileChannelin classFileSystemProvider- Throws:
IOException
-
newInputStream
- Overrides:
newInputStreamin classFileSystemProvider- Throws:
IOException
-
newOutputStream
- Overrides:
newOutputStreamin classFileSystemProvider- Throws:
IOException
-
newDirectoryStream
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException - Specified by:
newDirectoryStreamin classFileSystemProvider- Throws:
IOException
-
createDirectory
- Specified by:
createDirectoryin classFileSystemProvider- Throws:
IOException
-
createLink
- Overrides:
createLinkin classFileSystemProvider- Throws:
IOException
-
createSymbolicLink
public void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException - Overrides:
createSymbolicLinkin classFileSystemProvider- Throws:
IOException
-
readSymbolicLink
- Overrides:
readSymbolicLinkin classFileSystemProvider- Throws:
IOException
-
delete
- Specified by:
deletein classFileSystemProvider- Throws:
IOException
-
copy
- Specified by:
copyin classFileSystemProvider- Throws:
IOException
-
copy
private void copy(Path source, Path target, com.google.common.collect.ImmutableSet<CopyOption> options, boolean move) throws IOException - Throws:
IOException
-
move
- Specified by:
movein classFileSystemProvider- Throws:
IOException
-
isSameFile
- Specified by:
isSameFilein classFileSystemProvider- Throws:
IOException
-
isHidden
- Specified by:
isHiddenin classFileSystemProvider- Throws:
IOException
-
getFileStore
- Specified by:
getFileStorein classFileSystemProvider- Throws:
IOException
-
checkAccess
- Specified by:
checkAccessin classFileSystemProvider- Throws:
IOException
-
getFileAttributeView
public <V extends FileAttributeView> @Nullable V getFileAttributeView(Path path, Class<V> type, LinkOption... options) - Specified by:
getFileAttributeViewin classFileSystemProvider
-
readAttributes
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException - Specified by:
readAttributesin classFileSystemProvider- Throws:
IOException
-
readAttributes
public Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException - Specified by:
readAttributesin classFileSystemProvider- Throws:
IOException
-
setAttribute
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException - Specified by:
setAttributein classFileSystemProvider- Throws:
IOException
-