public class DummyContentItem extends Object implements ContentItem, Serializable
Constructor and Description |
---|
DummyContentItem(ContentLocation parent,
String name)
Creates a new dummy item for the given parent and having the given name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
delete()
A dummy location does not have content and therefore does not support the delete command.
|
Object |
getAttribute(String domain,
String key)
Dummy locations do not have attributes, therefore this method always returns null.
|
Object |
getContentId()
Returns the full pathname of the location.
|
InputStream |
getInputStream()
Returns an new empty input stream that does not allow to read a single byte from it.
|
String |
getMimeType()
Returns the mime type for the content entity.
|
String |
getName()
Returns the name of the entry.
|
OutputStream |
getOutputStream()
Returns a NullOutputStream that ignores all content given to it.
|
ContentLocation |
getParent()
Returns the parent, if there is any.
|
Repository |
getRepository()
Returns the parent repository for this location.
|
boolean |
isReadable()
Claims that the item is readable.
|
boolean |
isWriteable()
Claims that the item is writable.
|
boolean |
setAttribute(String domain,
String key,
Object value)
Dummy locations do not allow to set attributes, therefore this method always returns false.
|
public DummyContentItem(ContentLocation parent, String name)
parent
- the parent.name
- the name of the new item.public String getMimeType() throws ContentIOException
getMimeType
in interface ContentItem
ContentIOException
- if an error occured.public OutputStream getOutputStream()
getOutputStream
in interface ContentItem
public InputStream getInputStream()
getInputStream
in interface ContentItem
public boolean isReadable()
isReadable
in interface ContentItem
public boolean isWriteable()
isWriteable
in interface ContentItem
public String getName()
getName
in interface ContentEntity
public Object getContentId()
getContentId
in interface ContentEntity
public Object getAttribute(String domain, String key)
getAttribute
in interface ContentEntity
domain
- the attribute domain.key
- the name of the attribute.public boolean setAttribute(String domain, String key, Object value)
setAttribute
in interface ContentEntity
domain
- the attribute domain.key
- the attribute namevalue
- the new attribute value.public ContentLocation getParent()
getParent
in interface ContentEntity
public Repository getRepository()
getRepository
in interface ContentEntity
public boolean delete()
delete
in interface ContentEntity
Copyright © 2019 Hitachi Vantara. All rights reserved.