org.ejtools.archive
Class JarArchive

java.lang.Object
  |
  +--org.ejtools.archive.JarEntry
        |
        +--org.ejtools.archive.JarArchive
All Implemented Interfaces:
Archive, Entry

public class JarArchive
extends JarEntry
implements Archive

Implementation for a Jar based archive.

Version:
$Revision: 1.2 $
Author:
Laurent Etiemble

Constructor Summary
JarArchive(java.lang.String uri)
          Constructor for the JarArchive object
 
Method Summary
 void accept(Reader visitor)
          Visitor Pattern method to accept a Reader visitor
 void accept(Writer visitor)
          Visitor Pattern method to accept a Writer visitor
 void addEntry(Entry entry)
          Adds an entry to this archive
 void addTo(Archive archive)
          Adds a feature to the To attribute of the JarArchive object
 java.util.Enumeration getEntries()
          Returns an enumeration of entries contained in this archive
 Entry getEntry(java.lang.String uri)
          Returns the archive entry designated by this URI
 Entry getManifest()
          Returns the manifest entry of this archive
 Archive getParent()
          Return the parent archive of this archive
 boolean isArchive()
          Always returns true as it is an archive
 boolean isNested()
          Returns whether or not this archive is nested in an other archive
 java.util.Iterator iterator()
          Return an Iterator of the entries contained in this archive
 void removeEntry(Entry entry)
          Removes an entry from this archive
 void removeEntry(java.lang.String uri)
          Removes an entry from this archive
 
Methods inherited from class org.ejtools.archive.JarEntry
getContent, getURI, setContent, setURI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ejtools.archive.Entry
getContent, getURI, setContent, setURI
 

Constructor Detail

JarArchive

public JarArchive(java.lang.String uri)
Constructor for the JarArchive object

Parameters:
uri - The URI of the archive
Method Detail

accept

public void accept(Writer visitor)
Visitor Pattern method to accept a Writer visitor

Specified by:
accept in interface Entry
Overrides:
accept in class JarEntry
Parameters:
visitor - The writer visitor

accept

public void accept(Reader visitor)
Visitor Pattern method to accept a Reader visitor

Specified by:
accept in interface Entry
Overrides:
accept in class JarEntry
Parameters:
visitor - The reader visitor

addEntry

public void addEntry(Entry entry)
Adds an entry to this archive

Specified by:
addEntry in interface Archive
Parameters:
entry - The archive entry to be added

addTo

public void addTo(Archive archive)
Adds a feature to the To attribute of the JarArchive object

Specified by:
addTo in interface Entry
Overrides:
addTo in class JarEntry
Parameters:
archive - The feature to be added to the To attribute

getEntries

public java.util.Enumeration getEntries()
Returns an enumeration of entries contained in this archive

Specified by:
getEntries in interface Archive
Returns:
The entries enumeration

getEntry

public Entry getEntry(java.lang.String uri)
Returns the archive entry designated by this URI

Specified by:
getEntry in interface Archive
Parameters:
uri - The URI of the entry
Returns:
The archiev entry if exists

getManifest

public Entry getManifest()
Returns the manifest entry of this archive

Specified by:
getManifest in interface Archive
Returns:
The manifest entry

getParent

public Archive getParent()
Return the parent archive of this archive

Specified by:
getParent in interface Archive
Returns:
The parent value

isArchive

public boolean isArchive()
Always returns true as it is an archive

Specified by:
isArchive in interface Entry
Overrides:
isArchive in class JarEntry
Returns:
Always true

isNested

public boolean isNested()
Returns whether or not this archive is nested in an other archive

Specified by:
isNested in interface Archive
Returns:
True if it is nested

iterator

public java.util.Iterator iterator()
Return an Iterator of the entries contained in this archive

Specified by:
iterator in interface Archive
Returns:
The entries Iterator

removeEntry

public void removeEntry(java.lang.String uri)
Removes an entry from this archive

Specified by:
removeEntry in interface Archive
Parameters:
uri - The archive entry to be removed

removeEntry

public void removeEntry(Entry entry)
Removes an entry from this archive

Specified by:
removeEntry in interface Archive
Parameters:
entry - The archive entry to be removed


Copyright © 2002-2003 EJTools Org.. All Rights Reserved.