Class ZipContentItem
java.lang.Object
org.pentaho.reporting.libraries.repository.zipwriter.ZipContentItem
- All Implemented Interfaces:
ContentEntity, ContentItem
Creation-Date: 01.12.2006, 21:23:25
- Author:
- Thomas Morgner
-
Constructor Summary
ConstructorsConstructorDescriptionZipContentItem(String name, ZipRepository repository, ZipContentLocation parent) -
Method Summary
Modifier and TypeMethodDescriptionbooleandelete()Attempts to delete the entity.getAttribute(String domain, String key) Returns a attribute value for the given domain (namespace) and attribute-name.Returns a unique identifier.Tries to open and return a input stream for reading from the content item.Returns the mime type for the content entity.getName()Returns the name of the entry.Tries to open and return a output stream for writing into the content item.Returns a reference to the parent location.Returns the current repository, to which tis entity belongs.booleanChecks, whether the content item is readable.booleanChecks, whether the content item is writable.booleansetAttribute(String domain, String key, Object value) Updates the attribute value for the given attribute domain and name.
-
Constructor Details
-
ZipContentItem
-
-
Method Details
-
getMimeType
Description copied from interface:ContentItemReturns the mime type for the content entity. If the repository does not store mimetypes, this call usually uses the repositories MimeRegistry to resolve the mimetype.- Specified by:
getMimeTypein interfaceContentItem- Returns:
- the mime type.
- Throws:
ContentIOException- if an error occured.
-
getOutputStream
Description copied from interface:ContentItemTries to open and return a output stream for writing into the content item. This call will fail if the item is not writeable. Whether opening multiple output streams at the same time is possible is implementation dependent, but it is generally not recommended to try this. Having both an input and output stream open at the same time is not guaranteed to work. Generally if you need to append data, first open the inputstream and copy the content to a temporary location and then write the content along with the appended content to the new output stream.- Specified by:
getOutputStreamin interfaceContentItem- Returns:
- the output stream for writing the item.
- Throws:
ContentIOException- if an repository related error prevents the creation of the output stream.IOException- if an IO error occurs.
-
getInputStream
Description copied from interface:ContentItemTries to open and return a input stream for reading from the content item. This call will fail if the item is not readable. Whether opening multiple input streams at the same time is possible is implementation dependent. Having both an input and output stream open at the same time is not guaranteed to work. Generally if you need to append data, first open the inputstream and copy the content to a temporary location and then write the content along with the appended content to the new output stream.- Specified by:
getInputStreamin interfaceContentItem- Returns:
- the input stream for reading from the item.
- Throws:
ContentIOException- if an repository related error prevents the creation of the input stream.IOException- if an IO error occurs.
-
isReadable
public boolean isReadable()Description copied from interface:ContentItemChecks, whether the content item is readable. A content item that is not readable will never return a valid inputstream and any call to getInputStream is bound to fail.- Specified by:
isReadablein interfaceContentItem- Returns:
- true, if the content item is readable, false otherwise.
-
isWriteable
public boolean isWriteable()Description copied from interface:ContentItemChecks, whether the content item is writable. A content item that is not writable will never return a valid outputstream and any call to getOutputStream is bound to fail.- Specified by:
isWriteablein interfaceContentItem- Returns:
- true, if the content item is writeable, false otherwise.
-
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.
-
getRepository
Description copied from interface:ContentEntityReturns the current repository, to which tis entity belongs.- Specified by:
getRepositoryin interfaceContentEntity- Returns:
- the repository.
-
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.
-
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.
-