Class ZipReadContentLocation
java.lang.Object
org.pentaho.reporting.libraries.repository.zipreader.ZipReadContentLocation
- All Implemented Interfaces:
ContentEntity, ContentLocation
-
Constructor Summary
ConstructorsConstructorDescriptionZipReadContentLocation(ZipReadRepository repository, ZipReadContentLocation parent, String entryName) ZipReadContentLocation(ZipReadRepository repository, ZipReadContentLocation parent, ZipEntry zipEntry) -
Method Summary
Modifier and TypeMethodDescriptioncreateItem(String name) Creates a new data item in the current location.createLocation(String name) Creates a new content location in the current location.booleandelete()Attempts to delete the entity.booleanChecks, whether an content entity with the given name exists in this content location.getAttribute(String domain, String key) Returns a attribute value for the given domain (namespace) and attribute-name.Returns a unique identifier.Returns the content entity with the given name.getName()Returns the name of the entry.Returns a reference to the parent location.Returns the current repository, to which tis entity belongs.Returns all content entities stored in this content-location.booleansetAttribute(String domain, String key, Object value) Updates the attribute value for the given attribute domain and name.voidupdateDirectoryEntry(String[] name, int index, ZipEntry zipEntry) voidupdateEntry(String[] name, int index, ZipEntry zipEntry, byte[] data)
-
Constructor Details
-
ZipReadContentLocation
public ZipReadContentLocation(ZipReadRepository repository, ZipReadContentLocation parent, String entryName) -
ZipReadContentLocation
public ZipReadContentLocation(ZipReadRepository repository, ZipReadContentLocation parent, ZipEntry zipEntry)
-
-
Method Details
-
updateDirectoryEntry
-
updateEntry
-
listContents
Description copied from interface:ContentLocationReturns all content entities stored in this content-location.- Specified by:
listContentsin interfaceContentLocation- Returns:
- the content entities for this location.
- Throws:
ContentIOException- if an repository error occured.
-
getEntry
Description copied from interface:ContentLocationReturns the content entity with the given name. If the entity does not exist, an Exception will be raised.- Specified by:
getEntryin interfaceContentLocation- Parameters:
name- the name of the entity to be retrieved.- Returns:
- the content entity for this name, never null.
- Throws:
ContentIOException- if an repository error occured.
-
exists
Description copied from interface:ContentLocationChecks, whether an content entity with the given name exists in this content location.- Specified by:
existsin interfaceContentLocation- Parameters:
name- the name of the new entity.- Returns:
- true, if an entity exists with this name, false otherwise.
-
createItem
Description copied from interface:ContentLocationCreates a new data item in the current location. This method must never return null. This method will fail if an entity with the same name exists in this location.- Specified by:
createItemin interfaceContentLocation- Parameters:
name- the name of the new entity.- Returns:
- the newly created entity, never null.
- Throws:
ContentCreationException- if the item could not be created.
-
createLocation
Description copied from interface:ContentLocationCreates a new content location in the current location. This method must never return null. This method will fail if an entity with the same name exists in this location.- Specified by:
createLocationin interfaceContentLocation- Parameters:
name- the name of the new entity.- Returns:
- the newly created entity, never null.
- Throws:
ContentCreationException- if the item could not be created.
-
getName
Description copied from interface:ContentEntityReturns the name of the entry.- Specified by:
getNamein interfaceContentEntity- Returns:
- the name, never null.
-
getContentId
Description copied from interface:ContentEntityReturns a unique identifier. This can be canonical filename or a database key. It must be guaranteed that within the same repository the key will be unique.- Specified by:
getContentIdin interfaceContentEntity- Returns:
- the unique content ID.
-
getAttribute
Description copied from interface:ContentEntityReturns a attribute value for the given domain (namespace) and attribute-name. Some generic attribute domains and names are defined as constants in theLibRepositoryBootclass.- Specified by:
getAttributein interfaceContentEntity- Parameters:
domain- the attribute domain.key- the name of the attribute.- Returns:
- the value or null, if the content-entity does not have a value for this attribute.
-
setAttribute
Description copied from interface:ContentEntityUpdates the attribute value for the given attribute domain and name. If the element is not writable or the attribute could not be updated for any other reason, the method will return false. This method only returns true, if the attribute has been updated successfully.- Specified by:
setAttributein interfaceContentEntity- Parameters:
domain- the attribute domain.key- the attribute namevalue- the new attribute value.- Returns:
- true, if the update was successful, false otherwise.
-
getParent
Description copied from interface:ContentEntityReturns a reference to the parent location. If this entity represents the root directory, this method will return null.- Specified by:
getParentin interfaceContentEntity- Returns:
- the parent or null, if this is the root-directory.
-
getRepository
Description copied from interface:ContentEntityReturns the current repository, to which tis entity belongs.- Specified by:
getRepositoryin interfaceContentEntity- Returns:
- the repository.
-
delete
public boolean delete()Description copied from interface:ContentEntityAttempts to delete the entity. After an entity has been deleted, any call to any of the methods of the entity may produce undefined results.- Specified by:
deletein interfaceContentEntity- Returns:
- true, if the entity was deleted and detached from the repository, false otherwise.
-