org.restlet.engine.local
Class ZipEntryEntity

java.lang.Object
  extended by org.restlet.engine.local.Entity
      extended by org.restlet.engine.local.ZipEntryEntity

public class ZipEntryEntity
extends Entity

Local entity based on an entry in a Zip archive.

Author:
Remi Dewitte

Field Summary
protected  ZipEntry entry
          The Zip entry.
protected  ZipFile zipFile
          The Zip file.
 
Constructor Summary
ZipEntryEntity(ZipFile zipFile, String entryName, MetadataService metadataService)
          Constructor.
ZipEntryEntity(ZipFile zipFile, ZipEntry entry, MetadataService metadataService)
          Constructor.
 
Method Summary
 boolean exists()
          Indicates if the entity does exist.
 List<Entity> getChildren()
          Returns the list of contained entities if the current entity is a directory, null otherwise.
 String getName()
          Returns the name.
 Entity getParent()
          Returns the parent directory (if any).
 Representation getRepresentation(MediaType defaultMediaType, int timeToLive)
          Returns a representation of this local entity.
 boolean isDirectory()
          Indicates if the entity is a directory.
 boolean isNormal()
          Indicates if the entity is a normal entity, especially if it is not a directory.
 
Methods inherited from class org.restlet.engine.local.Entity
getBaseName, getBaseName, getExtensions, getExtensions, getExtensions, getMetadataService, getVariant, updateMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zipFile

protected final ZipFile zipFile
The Zip file.


entry

protected final ZipEntry entry
The Zip entry.

Constructor Detail

ZipEntryEntity

public ZipEntryEntity(ZipFile zipFile,
                      String entryName,
                      MetadataService metadataService)
Constructor.

Parameters:
zipFile - The Zip file.
entryName - The Zip entry name.
metadataService - The metadata service to use.

ZipEntryEntity

public ZipEntryEntity(ZipFile zipFile,
                      ZipEntry entry,
                      MetadataService metadataService)
Constructor.

Parameters:
zipFile - The Zip file.
entry - The Zip entry.
metadataService - The metadata service to use.
Method Detail

exists

public boolean exists()
Description copied from class: Entity
Indicates if the entity does exist.

Specified by:
exists in class Entity
Returns:
True if the entity does exists.

getChildren

public List<Entity> getChildren()
Description copied from class: Entity
Returns the list of contained entities if the current entity is a directory, null otherwise.

Specified by:
getChildren in class Entity
Returns:
The list of contained entities.

getName

public String getName()
Description copied from class: Entity
Returns the name.

Specified by:
getName in class Entity
Returns:
The name.

getParent

public Entity getParent()
Description copied from class: Entity
Returns the parent directory (if any).

Specified by:
getParent in class Entity
Returns:
The parent directory, null otherwise.

getRepresentation

public Representation getRepresentation(MediaType defaultMediaType,
                                        int timeToLive)
Description copied from class: Entity
Returns a representation of this local entity.

Specified by:
getRepresentation in class Entity
Returns:
A representation of this entity.

isDirectory

public boolean isDirectory()
Description copied from class: Entity
Indicates if the entity is a directory.

Specified by:
isDirectory in class Entity
Returns:
True if the entity is a directory.

isNormal

public boolean isNormal()
Description copied from class: Entity
Indicates if the entity is a normal entity, especially if it is not a directory.

Specified by:
isNormal in class Entity
Returns:
True if the entity is a normal entity.
See Also:
File.isFile(), File.isDirectory()


Copyright © 2005-2013 Restlet.