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 class
A file system representation for a VM that does not support NIO2.protected static class
A file system representation for a VM that does support NIO2. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Copies a file.private static <T> T
doPrivileged
(PrivilegedAction<T> action) A proxy forjava.security.AccessController#doPrivileged
that is activated if available.static FileSystem
Returns theFileSystem
instance to use.abstract void
Moves a file.
-
Constructor Details
-
FileSystem
public FileSystem()
-
-
Method Details
-
getInstance
Returns theFileSystem
instance to use.- Returns:
- The
FileSystem
instance to use.
-
doPrivileged
A proxy forjava.security.AccessController#doPrivileged
that 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.
-