APIdia Launch Partner
Top Description Methods
jdk.internal.jimage

public Interface ResourceEntries

Imports
java.util.stream.Stream

Accesses the underlying resource entries in a jimage file.

This is a special-case API designed only for use by the jlink tool, which read the raw jimage files. It is not the correct API for accessing jimage resources at runtime.

This API ignores the previewMode of the ImageReader from which it is obtained, and returns an unmapped view of entries (e.g. allowing for direct access of resources in the META-INF/preview/... namespace).

It disallows access to resource directories (i.e. "/modules/...") or packages entries (i.e. "/packages/...").

Use the ImageReader API to correctly account for preview mode at runtime.

Implementation Note

This class needs to maintain JDK 8 source compatibility. It is used internally in the JDK to implement jimage/jrtfs access, but also compiled and delivered as part of the jrtfs.jar to support access to the jimage file provided by the shipped JDK by tools running on JDK 8.

Method Summary

Modifier and TypeMethod and Description
public byte[]
getBytes(String name)

Returns a copy of a resource's content given its jimage name.

public Stream<String>
getEntryNames(String module)

Returns the jimage names for all resources in the given module, in random order.

public long
getSize(String name)

Returns the (uncompressed) size of a resource given its jimage name.

Method Detail

getBytesback to summary
public byte[] getBytes(String name)

Returns a copy of a resource's content given its jimage name.

Exceptions
NoSuchElementException:
if the resource does not exist.
getEntryNamesback to summary
public Stream<String> getEntryNames(String module)

Returns the jimage names for all resources in the given module, in random order. Entry names will always be prefixed by the given module name (e.g. "/<module-name>/...").

getSizeback to summary
public long getSize(String name)

Returns the (uncompressed) size of a resource given its jimage name.

Exceptions
NoSuchElementException:
if the resource does not exist.