Class CopyOnWriteFileSystem
java.lang.Object
java.nio.file.FileSystem
net.minecraft.util.filefix.virtualfilesystem.CopyOnWriteFileSystem
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Pathprivate DirectoryNodeprivate static final org.slf4j.Loggerprivate final CopyOnWriteFSProviderprivate final CopyOnWriteFSPathprivate final PathMatcherprivate final CopyOnWriteFileStoreprivate final Pathprivate final AtomicInteger -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCopyOnWriteFileSystem(String name, Path baseDirectory, Path tmpDirectory, PathMatcher skippedPaths) -
Method Summary
Modifier and TypeMethodDescriptionprivate DirectoryNodebuildFileTreeFrom(Path baseDirectory) voidclose()collectMoveOperations(Path outPath) private voidcollectMoveOperations(Path outPath, DirectoryNode folder, CopyOnWriteFileSystem.Moves result) static CopyOnWriteFileSystemcreate(String name, Path baseDirectory, Path tmpDirectory, PathMatcher skippedPaths) static voidcreateDirectories(List<Path> directories) (package private) Path(package private) DirectoryNodefileTree()getPathMatcher(String syntaxAndPattern) static voidhardLinkFiles(List<FileMove> moves) booleanisOpen()booleanstatic voidstatic voidmoveFilesWithRetry(List<FileMove> moves, CopyOption... options) provider()protected voidrootPath()store()tryRevertMoves(List<FileMove> moves, CopyOption... options)
-
Field Details
-
FILE_ATTRIBUTE_VIEWS
-
LOGGER
private static final org.slf4j.Logger LOGGER -
store
-
provider
-
baseDirectory
-
skippedPaths
-
tmpDirectory
-
rootPath
-
tmpFileIndex
-
fileTree
-
-
Constructor Details
-
CopyOnWriteFileSystem
private CopyOnWriteFileSystem(String name, Path baseDirectory, Path tmpDirectory, PathMatcher skippedPaths) throws IOException - Throws:
IOException
-
-
Method Details
-
create
public static CopyOnWriteFileSystem create(String name, Path baseDirectory, Path tmpDirectory, PathMatcher skippedPaths) throws IOException - Throws:
IOException
-
buildFileTreeFrom
- Throws:
IOException
-
resetFileTreeToBaseFolderContent
- Throws:
IOException
-
provider
- Specified by:
providerin classFileSystem
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFileSystem- Throws:
IOException
-
isOpen
public boolean isOpen()- Specified by:
isOpenin classFileSystem
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnlyin classFileSystem
-
getSeparator
- Specified by:
getSeparatorin classFileSystem
-
getRootDirectories
- Specified by:
getRootDirectoriesin classFileSystem
-
getFileStores
- Specified by:
getFileStoresin classFileSystem
-
supportedFileAttributeViews
- Specified by:
supportedFileAttributeViewsin classFileSystem
-
getPath
- Specified by:
getPathin classFileSystem
-
getPathMatcher
- Specified by:
getPathMatcherin classFileSystem
-
getUserPrincipalLookupService
- Specified by:
getUserPrincipalLookupServicein classFileSystem
-
newWatchService
- Specified by:
newWatchServicein classFileSystem
-
store
-
rootPath
-
fileTree
DirectoryNode fileTree() -
baseDirectory
-
tmpDirectory
-
createTemporaryFilePath
Path createTemporaryFilePath() -
backingFileSystem
-
collectMoveOperations
-
collectMoveOperations
private void collectMoveOperations(Path outPath, DirectoryNode folder, CopyOnWriteFileSystem.Moves result) -
createDirectories
- Throws:
IOException
-
hardLinkFiles
- Throws:
IOException
-
moveFiles
- Throws:
IOException
-
moveFilesWithRetry
public static void moveFilesWithRetry(List<FileMove> moves, CopyOption... options) throws IOException - Throws:
IOException
-
tryRevertMoves
-