org.entityfs.util.zip
Class ManualZipEntryInfo

java.lang.Object
  extended by org.entityfs.util.zip.ManualZipEntryInfo
All Implemented Interfaces:
ZipEntryInfo
Direct Known Subclasses:
ManualJarEntryInfo, ManualZipFileEntryInfo

public class ManualZipEntryInfo
extends Object
implements ZipEntryInfo

This ZipEntryInfo implementation uses manually set properties to create ZipEntry objects.

This implementation gives the created ZipEntry a name and a modification time. It can be subclassed add more information. (Override the addProperties(ZipEntry) method.)

Since:
1.0
Author:
Karl Gustafsson
In_jar:
entityfs-util

Constructor Summary
ManualZipEntryInfo(String name, long time)
          Constructor.
 
Method Summary
protected  void addProperties(ZipEntry ze)
          Subclasses can override this method to add more properties to the ZipEntry object.
protected  ZipEntry createZipEntry(String entryName)
          Create the ZipEntry instance.
 ZipEntry getZipEntry()
          Get the ZipEntry object for the entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManualZipEntryInfo

public ManualZipEntryInfo(String name,
                          long time)
Constructor.

Parameters:
name - The name of the entry as it appears in the Zip file, i.e. this name represents the absolute location in the Zip file, complete with slashes (but without a leading slash).
time - The modification time of the entry.
Method Detail

createZipEntry

protected ZipEntry createZipEntry(String entryName)
Create the ZipEntry instance. This can be overridden by subclasses to use other ZipEntry implementations.

Parameters:
entryName - The name of the entity.
Returns:
A ZipEntry.

addProperties

protected void addProperties(ZipEntry ze)
Subclasses can override this method to add more properties to the ZipEntry object. This implementation does nothing.

Java's ZipOutputStream does not give access to all properties though. Use the Zip builder from the At4J project for more control over the Zip file contents.

Parameters:
ze - The Zip entry.

getZipEntry

public ZipEntry getZipEntry()
Description copied from interface: ZipEntryInfo
Get the ZipEntry object for the entity. Entry names for directories have to end with a single slash (see ZipEntry.isDirectory()).

Specified by:
getZipEntry in interface ZipEntryInfo
Returns:
The ZipEntry object for the entity.