Top Description Fields Constructors Methods
org.glassfish.hk2.classmodel.reflect.util

public Class JarArchive

extends AbstractAdapter
Class Inheritance
Imports
org.glassfish.hk2.classmodel.reflect.Parser, java.net.URI, .URISyntaxException, java.io.File, .IOException, .InputStream, java.util.Enumeration, java.util.concurrent.atomic.AtomicInteger, java.util.jar.JarEntry, .JarFile, .Manifest, java.util.logging.Level, .Logger

Jar based archive abstraction

Field Summary

Modifier and TypeField and Description
private final JarFile
private final Parser
private final AtomicInteger
releaseCount

We need to maintain how many internal jars got opened so that we don't close our jar archive until all the sub scanning has been done successfully.

private final URI

Constructor Summary

AccessConstructor and Description
public
JarArchive(Parser parser, URI uri)

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 Manifest
getManifest()

Implements org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.getManifest.

Returns the manifest instance for the archive.

public URI
getURI()

Implements org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.getURI.

Returns the URI of the archive

public void
pack-priv void
Inherited from org.glassfish.hk2.classmodel.reflect.util.AbstractAdapter:
onAllEntries

Field Detail

jarback to summary
private final JarFile jar
parserback to summary
private final Parser parser
releaseCountback to summary
private final AtomicInteger releaseCount

We need to maintain how many internal jars got opened so that we don't close our jar archive until all the sub scanning has been done successfully.

uriback to summary
private final URI uri

Constructor Detail

JarArchiveback to summary
public JarArchive(Parser parser, URI uri) throws IOException

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
getManifestback to summary
public Manifest getManifest() throws IOException

Implements org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.getManifest.

Doc from org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.getManifest.

Returns the manifest instance for the archive.

Annotations
@Override
Exceptions
IOException:
if the manifest cannot be loaded.
getURIback to summary
public URI getURI()

Implements org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.getURI.

Doc from org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.getURI.

Returns the URI of the archive

Annotations
@Override
onSelectedEntriesback to summary
public void onSelectedEntries(ArchiveAdapter.Selector selector, ArchiveAdapter.EntryTask task, final Logger logger) throws IOException

Implements org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.onSelectedEntries.

Doc from org.glassfish.hk2.classmodel.reflect.ArchiveAdapter.onSelectedEntries.

perform a task on selected archive entries

Annotations
@Override
Exceptions
IOException:
can be generated while reading the archive entries
releaseCountback to summary
pack-priv void releaseCount() throws IOException