Quilt Loader 1
Loading...
Searching...
No Matches
org.quiltmc.loader.api.FasterFiles Class Reference

Provides various optimised replacements for Files which will be faster if the underlying FileSystem is a FasterFileSystem. More...

Static Public Member Functions

static Path createFile (Path path, FileAttribute<?>... attrs) throws IOException
 Direct method replacement for Files#createFile(Path, FileAttribute...), which may be slightly faster that it for FasterFileSystems.
static Path createDirectories (Path dir, FileAttribute<?>... attrs) throws IOException
static Path copy (Path source, Path target, CopyOption... options) throws IOException
static boolean isSymbolicLink (Path path)
static boolean isDirectory (Path path, LinkOption... options)
static boolean isRegularFile (Path path, LinkOption... options)
static boolean exists (Path path, LinkOption... options)
 Direct method replacement for Files#exists(Path, LinkOption...), which will be faster than it for FasterFileSystems.
static boolean notExists (Path path, LinkOption... options)
static boolean isReadable (Path path)
static boolean isWritable (Path path)
static boolean isExecutable (Path path)
static Stream< Path > list (Path dir) throws IOException
static Collection<? extends Path > getChildren (Path dir) throws IOException
 Very similar to list(Path), but returns a Collection rather than a Stream.

Detailed Description

Provides various optimised replacements for Files which will be faster if the underlying FileSystem is a FasterFileSystem.

(This is true for all quilt file systems, but won't be true for any others).

This only contains methods whose implementation in Files doesn't just directly call an equivalent method in FileSystemProvider.

Member Function Documentation

◆ createFile()

Path org.quiltmc.loader.api.FasterFiles.createFile ( Path path,
FileAttribute<?>... attrs ) throws IOException
inlinestatic

Direct method replacement for Files#createFile(Path, FileAttribute...), which may be slightly faster that it for FasterFileSystems.

See also
Files#createFile(Path, FileAttribute...)

◆ exists()

boolean org.quiltmc.loader.api.FasterFiles.exists ( Path path,
LinkOption... options )
inlinestatic

Direct method replacement for Files#exists(Path, LinkOption...), which will be faster than it for FasterFileSystems.

See also
Files#exists(Path, LinkOption...)

◆ getChildren()

Collection<? extends Path > org.quiltmc.loader.api.FasterFiles.getChildren ( Path dir) throws IOException
inlinestatic

Very similar to list(Path), but returns a Collection rather than a Stream.

This is generally much faster if the filesystem stores all files in a Map, but may be slower as it will need to collect all paths from list(Path) if this is not the case.

Returns
An unmodifiable Collection.

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