Top Description Fields Constructors Methods
org.eclipse.jetty.util

public Class MultiReleaseJarFile

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.Closeable, .IOException, java.nio.file.Files, .Path, java.util.Objects, java.util.stream.Stream, org.eclipse.jetty.util.resource.Resource, .ResourceFactory, org.slf4j.Logger, .LoggerFactory

Utility class to handle a Multi Release Jar file

Field Summary

Modifier and TypeField and Description
private final Path
private final Resource
private static final Logger
private final ResourceFactory.Closeable

Constructor Summary

AccessConstructor and Description
public
MultiReleaseJarFile(Path
The file to open
jarFile
)

Construct a multi release jar file for the current JVM version, ignoring directories.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public Stream<Path>
stream()

Returns: A stream of versioned entries from the jar, excluding META-INF/versions entries.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

jarFileback to summary
private final Path jarFile
jarResourceback to summary
private final Resource jarResource
LOGback to summary
private static final Logger LOG
resourceFactoryback to summary
private final ResourceFactory.Closeable resourceFactory

Constructor Detail

MultiReleaseJarFileback to summary
public MultiReleaseJarFile(Path jarFile)

Construct a multi release jar file for the current JVM version, ignoring directories.

Parameters
jarFile:Path

The file to open

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
streamback to summary
public Stream<Path> stream() throws IOException
Returns:Stream<Path>

A stream of versioned entries from the jar, excluding META-INF/versions entries.

Annotations
@SuppressWarnings:resource
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override