Class MemoryFileSystemProvider
java.lang.Object
java.nio.file.spi.FileSystemProvider
com.github.marschall.memoryfilesystem.MemoryFileSystemProvider
Creates memory file systems instances.
This class should not be used directly. Instead
FileSystems.newFileSystem(URI, Map)
should be used to create instances.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkAccess
(Path path, AccessMode... modes) void
copy
(Path source, Path target, CopyOption... options) void
createDirectory
(Path dir, FileAttribute<?>... attrs) void
createLink
(Path link, Path existing) void
createSymbolicLink
(Path link, Path target, FileAttribute<?>... attrs) void
boolean
deleteIfExists
(Path path) boolean
exists
(Path path, LinkOption... options) <V extends FileAttributeView>
VgetFileAttributeView
(Path path, Class<V> type, LinkOption... options) getFileStore
(Path path) getFileSystem
(URI uri) boolean
boolean
isSameFile
(Path path, Path path2) void
move
(Path source, Path target, CopyOption... options) newAsynchronousFileChannel
(Path path, Set<? extends OpenOption> options, 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) newInputStream
(Path path, OpenOption... options) newOutputStream
(Path path, OpenOption... options) <A extends BasicFileAttributes>
AreadAttributes
(Path path, Class<A> type, LinkOption... options) readAttributes
(Path path, String attributes, LinkOption... options) <A extends BasicFileAttributes>
AreadAttributesIfExists
(Path path, Class<A> type, LinkOption... options) readSymbolicLink
(Path link) void
setAttribute
(Path path, String attribute, Object value, LinkOption... options) Methods inherited from class java.nio.file.spi.FileSystemProvider
installedProviders, newFileSystem
-
Field Details
-
SCHEME
Name of the URI and URL scheme used by this provider.- See Also:
-
-
Constructor Details
-
MemoryFileSystemProvider
public MemoryFileSystemProvider()Default constructor called byServiceLoader
mechanism.
-
-
Method Details
-
getScheme
- Specified by:
getScheme
in classFileSystemProvider
-
newFileSystem
- Specified by:
newFileSystem
in classFileSystemProvider
- Throws:
IOException
-
getFileSystem
- Specified by:
getFileSystem
in classFileSystemProvider
-
getPath
- Specified by:
getPath
in classFileSystemProvider
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Specified by:
newByteChannel
in classFileSystemProvider
- Throws:
IOException
-
newFileChannel
public FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Overrides:
newFileChannel
in classFileSystemProvider
- Throws:
IOException
-
newAsynchronousFileChannel
public AsynchronousFileChannel newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) throws IOException - Overrides:
newAsynchronousFileChannel
in classFileSystemProvider
- Throws:
IOException
-
newInputStream
- Overrides:
newInputStream
in classFileSystemProvider
- Throws:
IOException
-
newOutputStream
- Overrides:
newOutputStream
in classFileSystemProvider
- Throws:
IOException
-
newDirectoryStream
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException - Specified by:
newDirectoryStream
in classFileSystemProvider
- Throws:
IOException
-
createDirectory
- Specified by:
createDirectory
in classFileSystemProvider
- Throws:
IOException
-
createSymbolicLink
public void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException - Overrides:
createSymbolicLink
in classFileSystemProvider
- Throws:
IOException
-
createLink
- Overrides:
createLink
in classFileSystemProvider
- Throws:
IOException
-
readSymbolicLink
- Overrides:
readSymbolicLink
in classFileSystemProvider
- Throws:
IOException
-
delete
- Specified by:
delete
in classFileSystemProvider
- Throws:
IOException
-
deleteIfExists
- Overrides:
deleteIfExists
in classFileSystemProvider
- Throws:
IOException
-
copy
- Specified by:
copy
in classFileSystemProvider
- Throws:
IOException
-
move
- Specified by:
move
in classFileSystemProvider
- Throws:
IOException
-
isSameFile
- Specified by:
isSameFile
in classFileSystemProvider
- Throws:
IOException
-
isHidden
- Specified by:
isHidden
in classFileSystemProvider
- Throws:
IOException
-
getFileStore
- Specified by:
getFileStore
in classFileSystemProvider
-
checkAccess
- Specified by:
checkAccess
in classFileSystemProvider
- Throws:
IOException
-
exists
-
getFileAttributeView
public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) - Specified by:
getFileAttributeView
in classFileSystemProvider
-
readAttributes
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException - Specified by:
readAttributes
in classFileSystemProvider
- Throws:
IOException
-
readAttributesIfExists
public <A extends BasicFileAttributes> A readAttributesIfExists(Path path, Class<A> type, LinkOption... options) throws IOException - Throws:
IOException
-
readAttributes
public Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException - Specified by:
readAttributes
in classFileSystemProvider
- Throws:
IOException
-
setAttribute
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException - Specified by:
setAttribute
in classFileSystemProvider
- Throws:
IOException
-