Class DummyContentItem
- java.lang.Object
-
- org.pentaho.reporting.libraries.repository.dummy.DummyContentItem
-
- All Implemented Interfaces:
java.io.Serializable,ContentEntity,ContentItem
public class DummyContentItem extends java.lang.Object implements ContentItem, java.io.Serializable
A dummy content item, that does not provide any input and that does swallow all content fed into it.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DummyContentItem(ContentLocation parent, java.lang.String name)Creates a new dummy item for the given parent and having the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete()A dummy location does not have content and therefore does not support the delete command.java.lang.ObjectgetAttribute(java.lang.String domain, java.lang.String key)Dummy locations do not have attributes, therefore this method always returns null.java.lang.ObjectgetContentId()Returns the full pathname of the location.java.io.InputStreamgetInputStream()Returns an new empty input stream that does not allow to read a single byte from it.java.lang.StringgetMimeType()Returns the mime type for the content entity.java.lang.StringgetName()Returns the name of the entry.java.io.OutputStreamgetOutputStream()Returns a NullOutputStream that ignores all content given to it.ContentLocationgetParent()Returns the parent, if there is any.RepositorygetRepository()Returns the parent repository for this location.booleanisReadable()Claims that the item is readable.booleanisWriteable()Claims that the item is writable.booleansetAttribute(java.lang.String domain, java.lang.String key, java.lang.Object value)Dummy locations do not allow to set attributes, therefore this method always returns false.
-
-
-
Constructor Detail
-
DummyContentItem
public DummyContentItem(ContentLocation parent, java.lang.String name)
Creates a new dummy item for the given parent and having the given name.- Parameters:
parent- the parent.name- the name of the new item.
-
-
Method Detail
-
getMimeType
public java.lang.String getMimeType() throws ContentIOExceptionReturns 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
public java.io.OutputStream getOutputStream()
Returns a NullOutputStream that ignores all content given to it.- Specified by:
getOutputStreamin interfaceContentItem- Returns:
- the output stream.
-
getInputStream
public java.io.InputStream getInputStream()
Returns an new empty input stream that does not allow to read a single byte from it.- Specified by:
getInputStreamin interfaceContentItem- Returns:
- the input stream.
-
isReadable
public boolean isReadable()
Claims that the item is readable.- Specified by:
isReadablein interfaceContentItem- Returns:
- true.
-
isWriteable
public boolean isWriteable()
Claims that the item is writable.- Specified by:
isWriteablein interfaceContentItem- Returns:
- true.
-
getName
public java.lang.String getName()
Returns the name of the entry.- Specified by:
getNamein interfaceContentEntity- Returns:
- the name, never null.
-
getContentId
public java.lang.Object getContentId()
Returns the full pathname of the location.- Specified by:
getContentIdin interfaceContentEntity- Returns:
- the full pathname.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String domain, java.lang.String key)Dummy locations do not have attributes, therefore this method always returns null.- 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
public boolean setAttribute(java.lang.String domain, java.lang.String key, java.lang.Object value)Dummy locations do not allow to set attributes, therefore this method always returns false.- Specified by:
setAttributein interfaceContentEntity- Parameters:
domain- the attribute domain.key- the attribute namevalue- the new attribute value.- Returns:
- false.
-
getParent
public ContentLocation getParent()
Returns the parent, if there is any.- Specified by:
getParentin interfaceContentEntity- Returns:
- the parent.
-
getRepository
public Repository getRepository()
Returns the parent repository for this location.- Specified by:
getRepositoryin interfaceContentEntity- Returns:
- the repository.
-
delete
public boolean delete()
A dummy location does not have content and therefore does not support the delete command.- Specified by:
deletein interfaceContentEntity- Returns:
- always false.
-
-