org.entityfs.util.zip
Class ZipEntryInfoImpl

java.lang.Object
  extended by org.entityfs.util.zip.ZipEntryInfoImpl
All Implemented Interfaces:
ZipEntryInfo
Direct Known Subclasses:
JarEntryInfoImpl, ZipFileEntryInfoImpl

public class ZipEntryInfoImpl
extends Object
implements ZipEntryInfo

Standard implementation of ZipEntryInfo. It adds the entity's name and last modification time to the created ZipEntry object. It can also use an optional ZipEntryInfoProvider to provide extra information to the ZipEntry objects that it creates.

The object's entity is locked for reading when collecting information about it.

Instances of this class are immutable.

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

Constructor Summary
ZipEntryInfoImpl(EntityView ent, AbsoluteLocation location, ZipEntryInfoProvider zeip)
          Constructor.
 
Method Summary
protected  ZipEntry createZipEntry(String entryName)
          Create the ZipEntry instance.
protected  EntityView getEntity()
           
protected  ZipEntryInfoProvider getExtraInfoProvider()
          Get the provider used to add extra information to created ZipEntry objects.
protected  AbsoluteLocation getLocation()
           
 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

ZipEntryInfoImpl

public ZipEntryInfoImpl(EntityView ent,
                        AbsoluteLocation location,
                        ZipEntryInfoProvider zeip)
Constructor.

Parameters:
ent - The entity.
location - The entity's location relative to the base directory for the Zip archive.
zeip - An provider of extra information. May be null.
Method Detail

getLocation

protected AbsoluteLocation getLocation()

getExtraInfoProvider

protected ZipEntryInfoProvider getExtraInfoProvider()
Get the provider used to add extra information to created ZipEntry objects.

Returns:
The extra info provider or null if not set.

getEntity

protected EntityView getEntity()

createZipEntry

protected ZipEntry createZipEntry(String entryName)
Create the ZipEntry instance. This can be overridden by subclasses to use other ZipEntry implementations. The entity is locked for reading when this method is called.

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

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.