Package net.bytebuddy.utility
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.private static <T> TdoPrivileged(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.static FileSystemReturns theFileSysteminstance to use.abstract voidMoves a file.
-
Constructor Details
-
FileSystem
public FileSystem()
-
-
Method Details
-
getInstance
Returns theFileSysteminstance to use.- Returns:
- The
FileSysteminstance to use.
-
doPrivileged
A proxy forjava.security.AccessController#doPrivilegedthat is activated if available.- Type Parameters:
T- The type of the action's resolved value.- Parameters:
action- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-
copy
Copies a file.- 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.
-