Top Description Inners Constructors Methods
net.bytebuddy.utility

public abstract Class FileSystem

extends Object
Class Inheritance
Known Direct Subclasses
net.bytebuddy.utility.FileSystem.ForLegacyVm, net.bytebuddy.utility.FileSystem.ForNio2CapableVm
Imports
net.bytebuddy.build.AccessControllerPlugin, .CachedReturnPlugin, .HashCodeAndEqualsPlugin, net.bytebuddy.dynamic.loading.ClassLoadingStrategy, net.bytebuddy.utility.dispatcher.JavaDispatcher, java.io.*, java.security.PrivilegedAction

A dispatcher to interact with the file system. If NIO2 is available, the API is used. Otherwise, byte streams are used.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
FileSystem.ForLegacyVm

A file system representation for a VM that does not support NIO2.

protected static class
FileSystem.ForNio2CapableVm

A file system representation for a VM that does support NIO2.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
copy(File
The source file.
source
,
File
The target file.
target
)

Copies a file.

private static <
The type of the action's resolved value.
T
>
T

Returns:

The action's resolved value.
doPrivileged
(PrivilegedAction<T>
The action to execute from a privileged context.
action
)

A proxy for java.security.AccessController#doPrivileged that is activated if available.

public static FileSystem

Returns:

The FileSystem instance to use.
getInstance
()

Returns the FileSystem instance to use.

public abstract void
move(File
The source file.
source
,
File
The target file.
target
)

Moves a file.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

FileSystemback to summary
public FileSystem()

Method Detail

copyback to summary
public abstract void copy(File source, File target) throws IOException

Copies a file.

Parameters
source:File

The source file.

target:File

The target file.

Exceptions
IOException:
If an I/O exception occurs.
doPrivilegedback to summary
private static <T> T doPrivileged(PrivilegedAction<T> action)

A proxy for java.security.AccessController#doPrivileged that is activated if available.

Parameters
<T>
The type of the action's resolved value.
action:PrivilegedAction<T>

The action to execute from a privileged context.

Returns:T

The action's resolved value.

Annotations
@Enhance
getInstanceback to summary
public static FileSystem getInstance()

Returns the FileSystem instance to use.

Returns:FileSystem

The FileSystem instance to use.

Annotations
@Enhance:INSTANCE
moveback to summary
public abstract void move(File source, File target) throws IOException

Moves a file.

Parameters
source:File

The source file.

target:File

The target file.

Exceptions
IOException:
If an I/O exception occurs.
net.bytebuddy.utility back to summary

protected Class FileSystem.ForLegacyVm

extends FileSystem
Class Inheritance
Annotations
@Enhance

A file system representation for a VM that does not support NIO2.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
copy(File
The source file.
source
,
File
The target file.
target
)

Implements abstract net.bytebuddy.utility.FileSystem.copy.

Copies a file.
public void
move(File
The source file.
source
,
File
The target file.
target
)

Implements abstract net.bytebuddy.utility.FileSystem.move.

Moves a file.
Inherited from net.bytebuddy.utility.FileSystem:
getInstance

Constructor Detail

ForLegacyVmback to summary
protected ForLegacyVm()

Method Detail

copyback to summary
public void copy(File source, File target) throws IOException

Implements abstract net.bytebuddy.utility.FileSystem.copy.

Doc from net.bytebuddy.utility.FileSystem.copy.

Copies a file.

Parameters
source:File

The source file.

target:File

The target file.

Annotations
@Override
Exceptions
IOException:
If an I/O exception occurs.
moveback to summary
public void move(File source, File target) throws IOException

Implements abstract net.bytebuddy.utility.FileSystem.move.

Doc from net.bytebuddy.utility.FileSystem.move.

Moves a file.

Parameters
source:File

The source file.

target:File

The target file.

Annotations
@Override
Exceptions
IOException:
If an I/O exception occurs.
net.bytebuddy.utility back to summary

protected Class FileSystem.ForNio2CapableVm

extends FileSystem
Class Inheritance
Annotations
@Enhance

A file system representation for a VM that does support NIO2.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static interface
FileSystem.ForNio2CapableVm.Dispatcher

A dispatcher to resolve a File to a java.nio.file.Path.

protected static interface
FileSystem.ForNio2CapableVm.Files

A dispatcher to access the java.nio.file.Files API.

protected static interface
FileSystem.ForNio2CapableVm.StandardCopyOption

A dispatcher to interact with java.nio.file.StandardCopyOption.

Field Summary

Modifier and TypeField and Description
private static final FileSystem.ForNio2CapableVm.Dispatcher
DISPATCHER

A dispatcher to resolve a File to a java.nio.file.Path.

private static final FileSystem.ForNio2CapableVm.Files
FILES

A dispatcher to resolve a dispatcher for java.nio.file.Files.

private static final FileSystem.ForNio2CapableVm.StandardCopyOption
STANDARD_COPY_OPTION

A dispatcher to interact with java.nio.file.StandardCopyOption.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
copy(File
The source file.
source
,
File
The target file.
target
)

Implements abstract net.bytebuddy.utility.FileSystem.copy.

Copies a file.
public void
move(File
The source file.
source
,
File
The target file.
target
)

Implements abstract net.bytebuddy.utility.FileSystem.move.

Moves a file.
Inherited from net.bytebuddy.utility.FileSystem:
getInstance

Field Detail

DISPATCHERback to summary
private static final FileSystem.ForNio2CapableVm.Dispatcher DISPATCHER

A dispatcher to resolve a File to a java.nio.file.Path.

FILESback to summary
private static final FileSystem.ForNio2CapableVm.Files FILES

A dispatcher to resolve a dispatcher for java.nio.file.Files.

STANDARD_COPY_OPTIONback to summary
private static final FileSystem.ForNio2CapableVm.StandardCopyOption STANDARD_COPY_OPTION

A dispatcher to interact with java.nio.file.StandardCopyOption.

Constructor Detail

ForNio2CapableVmback to summary
protected ForNio2CapableVm()

Method Detail

copyback to summary
public void copy(File source, File target) throws IOException

Implements abstract net.bytebuddy.utility.FileSystem.copy.

Doc from net.bytebuddy.utility.FileSystem.copy.

Copies a file.

Parameters
source:File

The source file.

target:File

The target file.

Annotations
@Override
Exceptions
IOException:
If an I/O exception occurs.
moveback to summary
public void move(File source, File target) throws IOException

Implements abstract net.bytebuddy.utility.FileSystem.move.

Doc from net.bytebuddy.utility.FileSystem.move.

Moves a file.

Parameters
source:File

The source file.

target:File

The target file.

Annotations
@Override
Exceptions
IOException:
If an I/O exception occurs.
net.bytebuddy.utility back to summary

protected Interface FileSystem.ForNio2CapableVm.Dispatcher

Annotations
@Proxied:File

A dispatcher to resolve a File to a java.nio.file.Path.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The transformed java.nio.file.Path.
toPath
(File
The file to convert.
value
)

Resolves a File to a java.nio.file.Path.

Method Detail

toPathback to summary
public Object toPath(File value) throws IOException

Resolves a File to a java.nio.file.Path.

Parameters
value:File

The file to convert.

Returns:Object

The transformed java.nio.file.Path.

Exceptions
IOException:
If an I/O exception occurs.
net.bytebuddy.utility back to summary

protected Interface FileSystem.ForNio2CapableVm.Files

Annotations
@Proxied:Files

A dispatcher to access the java.nio.file.Files API.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The copied file.
copy
(Object
The source java.nio.file.Path.
source
,
Object
The target java.nio.file.Path.
target
,
Object[]
An array of copy options.
option
)

Copies a file.

public Object

Returns:

The moved file.
move
(Object
The source java.nio.file.Path.
source
,
Object
The target java.nio.file.Path.
target
,
Object[]
An array of copy options.
option
)

Moves a file.

Method Detail

copyback to summary
public Object copy(Object source, Object target, Object[] option) throws IOException

Copies a file.

Parameters
source:Object

The source java.nio.file.Path.

target:Object

The target java.nio.file.Path.

option:Object[]

An array of copy options.

Returns:Object

The copied file.

Annotations
@IsStatic
Exceptions
IOException:
If an I/O exception occurs.
moveback to summary
public Object move(Object source, Object target, Object[] option) throws IOException

Moves a file.

Parameters
source:Object

The source java.nio.file.Path.

target:Object

The target java.nio.file.Path.

option:Object[]

An array of copy options.

Returns:Object

The moved file.

Annotations
@IsStatic
Exceptions
IOException:
If an I/O exception occurs.
net.bytebuddy.utility back to summary

protected Interface FileSystem.ForNio2CapableVm.StandardCopyOption

Annotations
@Proxied:StandardCopyOption

A dispatcher to interact with java.nio.file.StandardCopyOption.

Method Summary

Modifier and TypeMethod and Description
public Object[]

Returns:

An array of type java.nio.file.StandardCopyOption.
toArray
(int
The array's size.
size
)

Creates an array of type java.nio.file.StandardCopyOption.

public Object

Returns:

The enumeration value.
valueOf
(String
The enumeration name.
name
)

Resolve an enumeration for java.nio.file.StandardCopyOption.

Method Detail

toArrayback to summary
public Object[] toArray(int size)

Creates an array of type java.nio.file.StandardCopyOption.

Parameters
size:int

The array's size.

Returns:Object[]

An array of type java.nio.file.StandardCopyOption.

Annotations
@Container
valueOfback to summary
public Object valueOf(String name)

Resolve an enumeration for java.nio.file.StandardCopyOption.

Parameters
name:String

The enumeration name.

Returns:Object

The enumeration value.

Annotations
@IsStatic