Top Description Inners Methods
org.glassfish.hk2.classmodel.reflect

public Interface ArchiveAdapter

extends Closeable
Known Direct Implementers
org.glassfish.hk2.classmodel.reflect.util.AbstractAdapter
Imports
java.io.Closeable, .IOException, .InputStream, java.net.URI, java.util.jar.Manifest, java.util.logging.Logger

adapter for reading archive style structure
Author
Jerome Dochez

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ArchiveAdapter.Entry

Definition of an archive entry

public static interface
ArchiveAdapter.EntryTask

defines the notion of an archive entry task which is a task aimed to be run on particular archive entry.

public static interface

Method Summary

Modifier and TypeMethod and Description
public Manifest

Returns:

the archive's manifest
getManifest
()

Returns the manifest instance for the archive.

public URI

Returns:

URI of the archive
getURI
()

Returns the URI of the archive

public void
onAllEntries(ArchiveAdapter.EntryTask
the task to perform
task
,
Logger
for any logging activity
logger
)

perform a task on each archive entry

public void
onSelectedEntries(ArchiveAdapter.Selector
implementation to select the archive archive entries on which the task should be performed.
selector
,
ArchiveAdapter.EntryTask
the task to perform
task
,
Logger
for any logging activity
logger
)

perform a task on selected archive entries

Inherited from java.io.Closeable:
close

Method Detail

getManifestback to summary
public Manifest getManifest() throws IOException

Returns the manifest instance for the archive.

Returns:Manifest

the archive's manifest

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

Returns the URI of the archive

Returns:URI

URI of the archive

onAllEntriesback to summary
public void onAllEntries(ArchiveAdapter.EntryTask task, Logger logger) throws IOException

perform a task on each archive entry

Parameters
task:ArchiveAdapter.EntryTask

the task to perform

logger:Logger

for any logging activity

Exceptions
IOException:
can be generated while reading the archive entries
onSelectedEntriesback to summary
public void onSelectedEntries(ArchiveAdapter.Selector selector, ArchiveAdapter.EntryTask task, Logger logger) throws IOException

perform a task on selected archive entries

Parameters
selector:ArchiveAdapter.Selector

implementation to select the archive archive entries on which the task should be performed.

task:ArchiveAdapter.EntryTask

the task to perform

logger:Logger

for any logging activity

Exceptions
IOException:
can be generated while reading the archive entries
org.glassfish.hk2.classmodel.reflect back to summary

public final Class ArchiveAdapter.Entry

extends Object
Class Inheritance

Definition of an archive entry

Field Summary

Modifier and TypeField and Description
public final String
public final long

Constructor Summary

AccessConstructor and Description
public
Entry(String
the entry name
name
,
long
the entry size
size
,
boolean
true if this entry is a directory
isDirectory
)
Deprecated Use the other constructor, isDirectory is not used

creates a new archive entry

public
Entry(String
the entry name
name
,
long
the entry size
size
)

creates a new archive entry

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
public final String name
sizeback to summary
public final long size

Constructor Detail

Entryback to summary
public Entry(String name, long size, boolean isDirectory)

Deprecated

Use the other constructor, isDirectory is not used

creates a new archive entry

Parameters
name:String

the entry name

size:long

the entry size

isDirectory:boolean

true if this entry is a directory

Entryback to summary
public Entry(String name, long size)

creates a new archive entry

Parameters
name:String

the entry name

size:long

the entry size

org.glassfish.hk2.classmodel.reflect back to summary

public Interface ArchiveAdapter.EntryTask


defines the notion of an archive entry task which is a task aimed to be run on particular archive entry.

Method Summary

Modifier and TypeMethod and Description
public void
on(final ArchiveAdapter.Entry
the archive entry information such as its name, size...
e
,
InputStream
the archive entry content.
is
)

callback to do some processing on an archive entry.

Method Detail

onback to summary
public void on(final ArchiveAdapter.Entry e, InputStream is) throws IOException

callback to do some processing on an archive entry.

Parameters
e:ArchiveAdapter.Entry

the archive entry information such as its name, size...

is:InputStream

the archive entry content.

Exceptions
IOException:
if the input stream reading generates a failure
org.glassfish.hk2.classmodel.reflect back to summary

public Interface ArchiveAdapter.Selector


Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the archive entry has been selected for processing
isSelected
(final ArchiveAdapter.Entry
the archive entry information
entry
)

callback to select an archive for processing

Method Detail

isSelectedback to summary
public boolean isSelected(final ArchiveAdapter.Entry entry)

callback to select an archive for processing

Parameters
entry:ArchiveAdapter.Entry

the archive entry information

Returns:boolean

true if the archive entry has been selected for processing