Package net.bytebuddy.dynamic
Class DynamicType.Default.Dispatcher.ForJava7CapableVm
- java.lang.Object
-
- net.bytebuddy.dynamic.DynamicType.Default.Dispatcher.ForJava7CapableVm
-
- All Implemented Interfaces:
DynamicType.Default.Dispatcher
- Enclosing interface:
- DynamicType.Default.Dispatcher
@Enhance public static class DynamicType.Default.Dispatcher.ForJava7CapableVm extends java.lang.Object implements DynamicType.Default.Dispatcher
A dispatcher for VMs that are capable of NIO2.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Default.Dispatcher
DynamicType.Default.Dispatcher.CreationAction, DynamicType.Default.Dispatcher.ForJava7CapableVm, DynamicType.Default.Dispatcher.ForLegacyVm
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]
copyOptions
The copy options to apply.private java.lang.reflect.Method
move
Thejava.nio.Files#copy(Path,Path,CopyOption[])
method.private java.lang.reflect.Method
toPath
Thejava.io.File#toPath()
method.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForJava7CapableVm(java.lang.reflect.Method toPath, java.lang.reflect.Method move, java.lang.Object[] copyOptions)
Creates a new NIO2 capable dispatcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
copy(java.io.File source, java.io.File target)
Copies the source file to the target location.
-
-
-
Constructor Detail
-
ForJava7CapableVm
protected ForJava7CapableVm(java.lang.reflect.Method toPath, java.lang.reflect.Method move, java.lang.Object[] copyOptions)
Creates a new NIO2 capable dispatcher.- Parameters:
toPath
- Thejava.io.File#toPath()
method.move
- Thejava.nio.Files#move(Path,Path,CopyOption[])
method.copyOptions
- The copy options to apply.
-
-
Method Detail
-
copy
public boolean copy(java.io.File source, java.io.File target) throws java.io.IOException
Copies the source file to the target location.- Specified by:
copy
in interfaceDynamicType.Default.Dispatcher
- Parameters:
source
- The source file.target
- The target file.- Returns:
true
if the source file needs to be deleted.- Throws:
java.io.IOException
- If an I/O error occurs.
-
-