Quilt Loader 1
Loading...
Searching...
No Matches
org.quiltmc.loader.api.ExtendedFileSystem Interface Reference

A FileSystem which may support additional features, beyond those which normal file systems support. More...

Inheritance diagram for org.quiltmc.loader.api.ExtendedFileSystem:
org.quiltmc.loader.api.FasterFileSystem org.quiltmc.loader.impl.filesystem.QuiltUnifiedFileSystem org.quiltmc.loader.impl.filesystem.QuiltZipFileSystem

Public Member Functions

default Path copyOnWrite (Path source, Path target, CopyOption... options) throws IOException
 Copies the source file to the target file.
default Path mount (Path source, Path target, MountOption... options) throws IOException
 Mounts the given source file on the target file, such that all reads and writes will actually read and write the source file.
default boolean isMountedFile (Path file)
default boolean isCopyOnWrite (Path file)
default Path readMountTarget (Path file) throws IOException
 Reads the target of a mounted file, if it was created by mount(Path, Path, MountOption...).
Public Member Functions inherited from org.quiltmc.loader.api.FasterFileSystem
default Path createFile (Path path, FileAttribute<?>... attrs) throws IOException
 Either the same speed as, or slightly faster than Files#createFile(Path, FileAttribute...).
default Path createDirectories (Path dir, FileAttribute<?>... attrs) throws IOException
default Path copy (Path source, Path target, CopyOption... options) throws IOException
default boolean isSymbolicLink (Path path)
default boolean isDirectory (Path path, LinkOption... options)
default boolean isRegularFile (Path path, LinkOption[] options)
default boolean exists (Path path, LinkOption... options)
 Either the same speed as, or faster than Files#exists(Path, LinkOption...).
default boolean notExists (Path path, LinkOption... options)
 Either the same speed as, or faster than Files#notExists(Path, LinkOption...).
default boolean isReadable (Path path)
default boolean isWritable (Path path)
default boolean isExecutable (Path path)
default Stream< Path > list (Path dir) throws IOException
default Collection<? extends Path > getChildren (Path dir) throws IOException

Detailed Description

A FileSystem which may support additional features, beyond those which normal file systems support.

Similar to regular file systems, you should generally use ExtendedFiles to perform these operations.

Member Function Documentation

◆ copyOnWrite()

default Path org.quiltmc.loader.api.ExtendedFileSystem.copyOnWrite ( Path source,
Path target,
CopyOption... options ) throws IOException
inline

Copies the source file to the target file.

If the source file system is read-only then this will mount(Path, Path, MountOption...) the given file with MountOption#COPY_ON_WRITE.

Parameters
sourceA Path, which might not be in this FileSystem.
targetA Path which must be from this ExtendedFileSystem
Returns
target

Implemented in org.quiltmc.loader.impl.filesystem.QuiltUnifiedFileSystem.

◆ isCopyOnWrite()

default boolean org.quiltmc.loader.api.ExtendedFileSystem.isCopyOnWrite ( Path file)
inline
Returns
True if the given file was created by mount(Path, Path, MountOption...) with MountOption#COPY_ON_WRITE, and the file has not been modified since it was copied.

Implemented in org.quiltmc.loader.impl.filesystem.QuiltUnifiedFileSystem.

◆ isMountedFile()

default boolean org.quiltmc.loader.api.ExtendedFileSystem.isMountedFile ( Path file)
inline

◆ mount()

default Path org.quiltmc.loader.api.ExtendedFileSystem.mount ( Path source,
Path target,
MountOption... options ) throws IOException
inline

Mounts the given source file on the target file, such that all reads and writes will actually read and write the source file.

(The exact behaviour depends on the options given).

This is similar to Files#createSymbolicLink(Path, Path, java.nio.file.attribute.FileAttribute...) except the source and target files don't need to be on the same filesystem.

Note that this does not support mounting folders.

Parameters
sourceA path from any FileSystem.
targetA path from this ExtendedFileSystem.
optionsOptions which control how the file is mounted.
Exceptions
UnsupportedOperationExceptionif this filesystem doesn't support file mounts.

Implemented in org.quiltmc.loader.impl.filesystem.QuiltUnifiedFileSystem.

◆ readMountTarget()

default Path org.quiltmc.loader.api.ExtendedFileSystem.readMountTarget ( Path file) throws IOException
inline

Reads the target of a mounted file, if it was created by mount(Path, Path, MountOption...).

Exceptions
NotLinkExceptionif the given file is not a isMountedFile(Path).
UnsupportedOperationExceptionif this filesystem doesn't support file mounts.

Implemented in org.quiltmc.loader.impl.filesystem.QuiltUnifiedFileSystem, and org.quiltmc.loader.impl.filesystem.QuiltZipFileSystem.


The documentation for this interface was generated from the following file:
  • src/main/java/org/quiltmc/loader/api/ExtendedFileSystem.java