Package com.google.common.jimfs
Class JimfsFileSystemProvider
- java.lang.Object
-
- java.nio.file.spi.FileSystemProvider
-
- com.google.common.jimfs.JimfsFileSystemProvider
-
final class JimfsFileSystemProvider extends java.nio.file.spi.FileSystemProviderFileSystemProviderimplementation for Jimfs. This provider implements the actual file system operations but does not handle creation, caching or lookup of file systems. SeeSystemJimfsFileSystemProvider, which is theMETA-INF/services/entry for Jimfs, for those operations.
-
-
Field Summary
Fields Modifier and Type Field Description private static JimfsFileSystemProviderINSTANCEprivate static java.nio.file.attribute.FileAttribute<?>[]NO_ATTRS
-
Constructor Summary
Constructors Constructor Description JimfsFileSystemProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAccess(java.nio.file.Path path, java.nio.file.AccessMode... modes)private static JimfsPathcheckPath(java.nio.file.Path path)private voidcopy(java.nio.file.Path source, java.nio.file.Path target, com.google.common.collect.ImmutableSet<java.nio.file.CopyOption> options, boolean move)voidcopy(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)voidcreateDirectory(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs)voidcreateLink(java.nio.file.Path link, java.nio.file.Path existing)voidcreateSymbolicLink(java.nio.file.Path link, java.nio.file.Path target, java.nio.file.attribute.FileAttribute<?>... attrs)voiddelete(java.nio.file.Path path)private static FileSystemViewgetDefaultView(JimfsPath path)Returns the default file system view for the given path.<V extends java.nio.file.attribute.FileAttributeView>
@Nullable VgetFileAttributeView(java.nio.file.Path path, java.lang.Class<V> type, java.nio.file.LinkOption... options)java.nio.file.FileStoregetFileStore(java.nio.file.Path path)java.nio.file.FileSystemgetFileSystem(java.net.URI uri)private static JimfsFileSystemgetFileSystem(java.nio.file.Path path)Gets the file system for the given path.java.nio.file.PathgetPath(java.net.URI uri)java.lang.StringgetScheme()(package private) static JimfsFileSystemProviderinstance()Returns the singleton instance of this provider.booleanisHidden(java.nio.file.Path path)booleanisSameFile(java.nio.file.Path path, java.nio.file.Path path2)voidmove(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options)java.nio.channels.AsynchronousFileChannelnewAsynchronousFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, @Nullable java.util.concurrent.ExecutorService executor, java.nio.file.attribute.FileAttribute<?>... attrs)java.nio.channels.SeekableByteChannelnewByteChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)java.nio.file.DirectoryStream<java.nio.file.Path>newDirectoryStream(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter)java.nio.channels.FileChannelnewFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)java.nio.file.FileSystemnewFileSystem(java.net.URI uri, java.util.Map<java.lang.String,?> env)java.nio.file.FileSystemnewFileSystem(java.nio.file.Path path, java.util.Map<java.lang.String,?> env)java.io.InputStreamnewInputStream(java.nio.file.Path path, java.nio.file.OpenOption... options)private JimfsFileChannelnewJimfsFileChannel(JimfsPath path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs)java.io.OutputStreamnewOutputStream(java.nio.file.Path path, java.nio.file.OpenOption... options)<A extends java.nio.file.attribute.BasicFileAttributes>
AreadAttributes(java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options)java.util.Map<java.lang.String,java.lang.Object>readAttributes(java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption... options)java.nio.file.PathreadSymbolicLink(java.nio.file.Path link)voidsetAttribute(java.nio.file.Path path, java.lang.String attribute, java.lang.Object value, java.nio.file.LinkOption... options)
-
-
-
Field Detail
-
INSTANCE
private static final JimfsFileSystemProvider INSTANCE
-
NO_ATTRS
private static final java.nio.file.attribute.FileAttribute<?>[] NO_ATTRS
-
-
Method Detail
-
instance
static JimfsFileSystemProvider instance()
Returns the singleton instance of this provider.
-
getScheme
public java.lang.String getScheme()
- Specified by:
getSchemein classjava.nio.file.spi.FileSystemProvider
-
newFileSystem
public java.nio.file.FileSystem newFileSystem(java.net.URI uri, java.util.Map<java.lang.String,?> env) throws java.io.IOException- Specified by:
newFileSystemin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
newFileSystem
public java.nio.file.FileSystem newFileSystem(java.nio.file.Path path, java.util.Map<java.lang.String,?> env) throws java.io.IOException- Overrides:
newFileSystemin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
getFileSystem
public java.nio.file.FileSystem getFileSystem(java.net.URI uri)
- Specified by:
getFileSystemin classjava.nio.file.spi.FileSystemProvider
-
getFileSystem
private static JimfsFileSystem getFileSystem(java.nio.file.Path path)
Gets the file system for the given path.
-
getPath
public java.nio.file.Path getPath(java.net.URI uri)
- Specified by:
getPathin classjava.nio.file.spi.FileSystemProvider
-
checkPath
private static JimfsPath checkPath(java.nio.file.Path path)
-
getDefaultView
private static FileSystemView getDefaultView(JimfsPath path)
Returns the default file system view for the given path.
-
newFileChannel
public java.nio.channels.FileChannel newFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Overrides:
newFileChannelin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
newJimfsFileChannel
private JimfsFileChannel newJimfsFileChannel(JimfsPath path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException
- Throws:
java.io.IOException
-
newByteChannel
public java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Specified by:
newByteChannelin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
newAsynchronousFileChannel
public java.nio.channels.AsynchronousFileChannel newAsynchronousFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, @Nullable java.util.concurrent.ExecutorService executor, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Overrides:
newAsynchronousFileChannelin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
newInputStream
public java.io.InputStream newInputStream(java.nio.file.Path path, java.nio.file.OpenOption... options) throws java.io.IOException- Overrides:
newInputStreamin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
newOutputStream
public java.io.OutputStream newOutputStream(java.nio.file.Path path, java.nio.file.OpenOption... options) throws java.io.IOException- Overrides:
newOutputStreamin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
newDirectoryStream
public java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) throws java.io.IOException- Specified by:
newDirectoryStreamin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
createDirectory
public void createDirectory(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Specified by:
createDirectoryin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
createLink
public void createLink(java.nio.file.Path link, java.nio.file.Path existing) throws java.io.IOException- Overrides:
createLinkin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
createSymbolicLink
public void createSymbolicLink(java.nio.file.Path link, java.nio.file.Path target, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException- Overrides:
createSymbolicLinkin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
readSymbolicLink
public java.nio.file.Path readSymbolicLink(java.nio.file.Path link) throws java.io.IOException- Overrides:
readSymbolicLinkin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
delete
public void delete(java.nio.file.Path path) throws java.io.IOException- Specified by:
deletein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
copy
public void copy(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options) throws java.io.IOException- Specified by:
copyin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
copy
private void copy(java.nio.file.Path source, java.nio.file.Path target, com.google.common.collect.ImmutableSet<java.nio.file.CopyOption> options, boolean move) throws java.io.IOException- Throws:
java.io.IOException
-
move
public void move(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options) throws java.io.IOException- Specified by:
movein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
isSameFile
public boolean isSameFile(java.nio.file.Path path, java.nio.file.Path path2) throws java.io.IOException- Specified by:
isSameFilein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
isHidden
public boolean isHidden(java.nio.file.Path path) throws java.io.IOException- Specified by:
isHiddenin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
getFileStore
public java.nio.file.FileStore getFileStore(java.nio.file.Path path) throws java.io.IOException- Specified by:
getFileStorein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
checkAccess
public void checkAccess(java.nio.file.Path path, java.nio.file.AccessMode... modes) throws java.io.IOException- Specified by:
checkAccessin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
getFileAttributeView
public <V extends java.nio.file.attribute.FileAttributeView> @Nullable V getFileAttributeView(java.nio.file.Path path, java.lang.Class<V> type, java.nio.file.LinkOption... options)- Specified by:
getFileAttributeViewin classjava.nio.file.spi.FileSystemProvider
-
readAttributes
public <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path path, java.lang.Class<A> type, java.nio.file.LinkOption... options) throws java.io.IOException- Specified by:
readAttributesin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
readAttributes
public java.util.Map<java.lang.String,java.lang.Object> readAttributes(java.nio.file.Path path, java.lang.String attributes, java.nio.file.LinkOption... options) throws java.io.IOException- Specified by:
readAttributesin classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
setAttribute
public void setAttribute(java.nio.file.Path path, java.lang.String attribute, java.lang.Object value, java.nio.file.LinkOption... options) throws java.io.IOException- Specified by:
setAttributein classjava.nio.file.spi.FileSystemProvider- Throws:
java.io.IOException
-
-