Class FileSystem
java.lang.Object
net.bytebuddy.utility.FileSystem
- Direct Known Subclasses:
FileSystem.ForLegacyVm, FileSystem.ForNio2CapableVm
A dispatcher to interact with the file system. If NIO2 is available, the API is used. Otherwise, byte streams are used.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA file system representation for a VM that does not support NIO2.protected static classA file system representation for a VM that does support NIO2. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidCopies a file.static FileSystemReturns theFileSysteminstance to use.voidLinks a file as a hard-link.abstract voidMoves a file.
-
Constructor Details
-
FileSystem
public FileSystem()
-
-
Method Details
-
getInstance
Returns theFileSysteminstance to use.- Returns:
- The
FileSysteminstance to use.
-
copy
Copies a file.- Parameters:
source- The source file.target- The target file.- Throws:
IOException- If an I/O exception occurs.
-
link
Links a file as a hard-link. If linking is not supported, a copy is made.- Parameters:
source- The source file.target- The target file.- Throws:
IOException- If an I/O exception occurs.
-
move
Moves a file.- Parameters:
source- The source file.target- The target file.- Throws:
IOException- If an I/O exception occurs.
-