Top Description Inners Methods
jdk.tools.jlink.plugin

public Interface ResourcePoolEntry

Known Direct Implementers
jdk.tools.jlink.internal.AbstractResourcePoolEntry
Imports
java.io.InputStream, .IOException, .OutputStream, .UncheckedIOException, java.nio.file.Path, jdk.tools.jlink.internal.ResourcePoolEntryFactory

A ResourcePoolEntry is the elementary unit of data inside an image. It is generally a file. e.g.: a java class file, a resource file, a shared library.
A ResourcePoolEntry is identified by a path of the form:

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ResourcePoolEntry.Type

Type of module data.

Method Summary

Modifier and TypeMethod and Description
public InputStream

Returns:

The resource content as an InputStream.
content
()

The ResourcePoolEntry content as an InputStream.

public default byte[]

Returns:

An Array of bytes.
contentBytes
()

The ResourcePoolEntry content as an array of bytes.

public long

Returns:

The content length.
contentLength
()

The ResourcePoolEntry content length.

public default ResourcePoolEntry

Returns:

A new ResourcePoolEntry.
copyWithContent
(byte[]
The new resource content.
content
)

Create a ResourcePoolEntry with new content but other information copied from this ResourcePoolEntry.

public default ResourcePoolEntry

Returns:

A new ResourcePoolEntry.
copyWithContent
(Path
The new resource content.
file
)

Create a ResourcePoolEntry with new content but other information copied from this ResourcePoolEntry.

public static ResourcePoolEntry

Returns:

A new ResourcePoolEntry.
create
(String
The resource path.
path
,
ResourcePoolEntry.Type
The ResourcePoolEntry type.
type
,
byte[]
The resource content.
content
)

Create a ResourcePoolEntry for a resource of the given type.

public static ResourcePoolEntry

Returns:

A new ResourcePoolEntry.
create
(String
The resource path.
path
,
byte[]
The resource content.
content
)

Create a ResourcePoolEntry for a resource of type Type#CLASS_OR_RESOURCE.

public static ResourcePoolEntry

Returns:

A new ResourcePoolEntry.
create
(String
The resource path.
path
,
ResourcePoolEntry.Type
The ResourcePoolEntry type.
type
,
Path
The resource file.
file
)

Create a ResourcePoolEntry for a resource of the given type.

public static ResourcePoolEntry

Returns:

A new ResourcePoolEntry.
create
(String
The resource path.
path
,
Path
The resource file.
file
)

Create a ResourcePoolEntry for a resource of type Type#CLASS_OR_RESOURCE.

public default ResourcePoolEntry

Returns:

the target ResourcePoolEntry linked with this entry.
linkedTarget
()

Returns a target linked with this entry.

public String

Returns:

The module name.
moduleName
()

The module name of this ResourcePoolEntry.

public String

Returns:

The module path.
path
()

The path of this ResourcePoolEntry.

public ResourcePoolEntry.Type

Returns:

The data type.
type
()

The ResourcePoolEntry's type.

public default void
write(OutputStream
the output stream
out
)

Write the content of this ResourcePoolEntry to an OutputStream.

Method Detail

contentback to summary
public InputStream content()

The ResourcePoolEntry content as an InputStream.

Returns:InputStream

The resource content as an InputStream.

contentBytesback to summary
public default byte[] contentBytes()

The ResourcePoolEntry content as an array of bytes.

Returns:byte[]

An Array of bytes.

contentLengthback to summary
public long contentLength()

The ResourcePoolEntry content length.

Returns:long

The content length.

copyWithContentback to summary
public default ResourcePoolEntry copyWithContent(byte[] content)

Create a ResourcePoolEntry with new content but other information copied from this ResourcePoolEntry.

Parameters
content:byte[]

The new resource content.

Returns:ResourcePoolEntry

A new ResourcePoolEntry.

copyWithContentback to summary
public default ResourcePoolEntry copyWithContent(Path file)

Create a ResourcePoolEntry with new content but other information copied from this ResourcePoolEntry.

Parameters
file:Path

The new resource content.

Returns:ResourcePoolEntry

A new ResourcePoolEntry.

createback to summary
public static ResourcePoolEntry create(String path, ResourcePoolEntry.Type type, byte[] content)

Create a ResourcePoolEntry for a resource of the given type.

Parameters
path:String

The resource path.

type:ResourcePoolEntry.Type

The ResourcePoolEntry type.

content:byte[]

The resource content.

Returns:ResourcePoolEntry

A new ResourcePoolEntry.

createback to summary
public static ResourcePoolEntry create(String path, byte[] content)

Create a ResourcePoolEntry for a resource of type Type#CLASS_OR_RESOURCE.

Parameters
path:String

The resource path.

content:byte[]

The resource content.

Returns:ResourcePoolEntry

A new ResourcePoolEntry.

createback to summary
public static ResourcePoolEntry create(String path, ResourcePoolEntry.Type type, Path file)

Create a ResourcePoolEntry for a resource of the given type.

Parameters
path:String

The resource path.

type:ResourcePoolEntry.Type

The ResourcePoolEntry type.

file:Path

The resource file.

Returns:ResourcePoolEntry

A new ResourcePoolEntry.

createback to summary
public static ResourcePoolEntry create(String path, Path file)

Create a ResourcePoolEntry for a resource of type Type#CLASS_OR_RESOURCE.

Parameters
path:String

The resource path.

file:Path

The resource file.

Returns:ResourcePoolEntry

A new ResourcePoolEntry.

linkedTargetback to summary
public default ResourcePoolEntry linkedTarget()

Returns a target linked with this entry.

Implementation Specification

The default implementation returns null.

Returns:ResourcePoolEntry

the target ResourcePoolEntry linked with this entry.

moduleNameback to summary
public String moduleName()

The module name of this ResourcePoolEntry.

Returns:String

The module name.

pathback to summary
public String path()

The path of this ResourcePoolEntry.

Returns:String

The module path.

typeback to summary
public ResourcePoolEntry.Type type()

The ResourcePoolEntry's type.

Returns:ResourcePoolEntry.Type

The data type.

writeback to summary
public default void write(OutputStream out)

Write the content of this ResourcePoolEntry to an OutputStream.

Parameters
out:OutputStream

the output stream

jdk.tools.jlink.plugin back to summary

public final Enum ResourcePoolEntry.Type

extends Enum<ResourcePoolEntry.Type>
Class Inheritance

Type of module data.
    • CLASS_OR_RESOURCE: A java class or resource file.
      CONFIG: A configuration file.
      HEADER_FILE: A header file.
      LEGAL_NOTICE: A legal notice.
      MAN_PAGE: A man page.
      NATIVE_CMD: A native executable launcher.
      NATIVE_LIB: A native library.
      TOP: A top-level file in the jdk run-time image directory.
  • Field Summary

    Modifier and TypeField and Description
    public static final ResourcePoolEntry.Type
    public static final ResourcePoolEntry.Type
    public static final ResourcePoolEntry.Type
    public static final ResourcePoolEntry.Type
    public static final ResourcePoolEntry.Type
    public static final ResourcePoolEntry.Type
    public static final ResourcePoolEntry.Type
    public static final ResourcePoolEntry.Type

    Constructor Summary

    AccessConstructor and Description
    private
    Type()

    Method Summary

    Modifier and TypeMethod and Description
    public static ResourcePoolEntry.Type
    public static ResourcePoolEntry.Type[]
    Inherited from java.lang.Enum:
    clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

    Field Detail

    CLASS_OR_RESOURCEback to summary
    public static final ResourcePoolEntry.Type CLASS_OR_RESOURCE
    CONFIGback to summary
    public static final ResourcePoolEntry.Type CONFIG
    HEADER_FILEback to summary
    public static final ResourcePoolEntry.Type HEADER_FILE
    LEGAL_NOTICEback to summary
    public static final ResourcePoolEntry.Type LEGAL_NOTICE
    MAN_PAGEback to summary
    public static final ResourcePoolEntry.Type MAN_PAGE
    NATIVE_CMDback to summary
    public static final ResourcePoolEntry.Type NATIVE_CMD
    NATIVE_LIBback to summary
    public static final ResourcePoolEntry.Type NATIVE_LIB
    TOPback to summary
    public static final ResourcePoolEntry.Type TOP

    Constructor Detail

    Typeback to summary
    private Type()

    Method Detail

    valueOfback to summary
    public static ResourcePoolEntry.Type valueOf(String name)
    valuesback to summary
    public static ResourcePoolEntry.Type[] values()