org.entityfs.zip.cap.entity
Class ECZipEntryUtil

java.lang.Object
  extended by org.entityfs.zip.cap.entity.ECZipEntryUtil

public final class ECZipEntryUtil
extends Object

This is a utility class with static utility methods for working with entities supporting the ECZipEntry capability.

The methods in this class will use the locking strategy for utility classes described in EntityLock.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ECZipEntry

Method Summary
static String getComment(EntityView ent)
          Get the ZipEntry comment.
static long getCompressedSize(EntityView ent)
          Get the ZipEntry compressed size, if known.
static long getCrc(EntityView ent)
          Get the ZipEntry CRC-32 checksum, if known.
static byte[] getExtra(EntityView ent)
          Get the ZipEntry extra data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getExtra

public static byte[] getExtra(EntityView ent)
                       throws UnsupportedCapabilityException
Get the ZipEntry extra data.

Entity locks that this method will acquire (temporarily):

Parameters:
ent - The entity. It must support the ECZipEntry capability.
Returns:
The ZipEntry extra data, or null if none.
Throws:
UnsupportedCapabilityException - If the entity does not support the ECZipEntry capability.

getCrc

public static long getCrc(EntityView ent)
                   throws UnsupportedCapabilityException
Get the ZipEntry CRC-32 checksum, if known.

Entity locks that this method will acquire (temporarily):

Parameters:
ent - The entity. It must support the ECZipEntry capability.
Returns:
The ZipEntry CRC-32 checksum, or -1 if it is not known.
Throws:
UnsupportedCapabilityException - If the entity does not support the ECZipEntry capability.

getCompressedSize

public static long getCompressedSize(EntityView ent)
                              throws UnsupportedCapabilityException
Get the ZipEntry compressed size, if known.

Entity locks that this method will acquire (temporarily):

Parameters:
ent - The entity. It must support the ECZipEntry capability.
Returns:
The ZipEntry compressed size, or -1 if not known.
Throws:
UnsupportedCapabilityException - If the entity does not support the ECZipEntry capability.

getComment

public static String getComment(EntityView ent)
                         throws UnsupportedCapabilityException
Get the ZipEntry comment.

Entity locks that this method will acquire (temporarily):

Parameters:
ent - The entity. It must support the ECZipEntry capability.
Returns:
The ZipEntry comment, or null if none.
Throws:
UnsupportedCapabilityException - If the entity does not support the ECZipEntry capability.