tuweni / org.apache.tuweni.io.file / Files / copyResource

copyResource

static fun copyResource(resourceName: String, destination: Path, vararg options: OpenOption): Path (source)

Copies the content of a resource to a file.

Parameters

resourceName - The resource name.

destination - The destination file.

options - Options specifying how the destination file should be opened.

Exceptions

IOException - If an I/O error occurs.

Return
The destination file.

static fun copyResource(classloader: ClassLoader, resourceName: String, destination: Path, vararg options: OpenOption): Path (source)

Copies the content of a resource to a file.

Parameters

classloader - The class loader of the resource.

resourceName - The resource name.

destination - The destination file.

options - Options specifying how the destination file should be opened.

Exceptions

IOException - If an I/O error occurs.

Return
The destination file.

static fun copyResource(resourceName: String, out: OutputStream): Long (source)

Copies the content of a resource to an output stream.

Parameters

resourceName - The resource name.

out - The output stream.

Exceptions

IOException - If an I/O error occurs.

Return
The total bytes written.

static fun copyResource(classloader: ClassLoader, resourceName: String, out: OutputStream): Long (source)

Copies the content of a resource to an output stream.

Parameters

classloader - The class loader.

resourceName - The resource name.

out - The output stream.

Exceptions

IOException - If an I/O error occurs.

Return
The total bytes written.