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 - String!: The resource name.

destination - Path!: The destination file.

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

Exceptions

IOException - If an I/O error occurs.

Return
Path!: 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 - ClassLoader!: The class loader of the resource.

resourceName - String!: The resource name.

destination - Path!: The destination file.

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

Exceptions

IOException - If an I/O error occurs.

Return
Path!: The destination file.

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

Copies the content of a resource to an output stream.

Parameters

resourceName - String!: The resource name.

out - OutputStream!: The output stream.

Exceptions

IOException - If an I/O error occurs.

Return
Long: 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 - ClassLoader!: The class loader.

resourceName - String!: The resource name.

out - OutputStream!: The output stream.

Exceptions

IOException - If an I/O error occurs.

Return
Long: The total bytes written.