org.entityfs.util.zip
Class CompoundZipEntryInfoProvider

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<ZipEntryInfoProvider>
              extended by org.entityfs.util.zip.CompoundZipEntryInfoProvider
All Implemented Interfaces:
Serializable, Cloneable, Iterable<ZipEntryInfoProvider>, Collection<ZipEntryInfoProvider>, List<ZipEntryInfoProvider>, RandomAccess, ZipEntryInfoProvider

public class CompoundZipEntryInfoProvider
extends ArrayList<ZipEntryInfoProvider>
implements ZipEntryInfoProvider

This is a ZipEntryInfoProvider that adds all information from a list of other providers. The providers are run in the order that they were added to the list.

This can be used to use more than one entry info providers when creating a Zip archive.

Adding and removing providers from the list is not a thread safe operation.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ZipCreator, Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
CompoundZipEntryInfoProvider()
          Create a CompoundZipEntryInfoProvider with a list of providers that is initially empty.
CompoundZipEntryInfoProvider(Collection<? extends ZipEntryInfoProvider> c)
          Create a CompoundZipEntryInfoProvider that initially contains the provided collection of providers, listed in the order that they are returned when iterating over the collection.
 
Method Summary
 void addProperties(ZipEntry ze, Object o)
          Add properties to the ZipEntry object based on the properties of the entity.
 CompoundZipEntryInfoProvider addProvider(ZipEntryInfoProvider zeip)
          Add one provider to the provider list.
 CompoundZipEntryInfoProvider addProviders(Collection<? extends ZipEntryInfoProvider> c)
          Add a collection of providers to the provider list.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

CompoundZipEntryInfoProvider

public CompoundZipEntryInfoProvider()
Create a CompoundZipEntryInfoProvider with a list of providers that is initially empty.


CompoundZipEntryInfoProvider

public CompoundZipEntryInfoProvider(Collection<? extends ZipEntryInfoProvider> c)
Create a CompoundZipEntryInfoProvider that initially contains the provided collection of providers, listed in the order that they are returned when iterating over the collection.

Parameters:
c - The collection of providers.
Method Detail

addProperties

public void addProperties(ZipEntry ze,
                          Object o)
Description copied from interface: ZipEntryInfoProvider
Add properties to the ZipEntry object based on the properties of the entity.

Specified by:
addProperties in interface ZipEntryInfoProvider
Parameters:
ze - The ZipEntry object to add properties to.
o - The object to add properties for. If this is a ReadLockable object, it is locked for reading when this method is called.

addProvider

public CompoundZipEntryInfoProvider addProvider(ZipEntryInfoProvider zeip)
Add one provider to the provider list.

Parameters:
zeip - The provider.
Returns:
this.

addProviders

public CompoundZipEntryInfoProvider addProviders(Collection<? extends ZipEntryInfoProvider> c)
Add a collection of providers to the provider list. The providers are added in the order that they are returned when iterating over the collection.

Parameters:
c - The provider collection.
Returns:
this