public class StreamContentItem extends Object implements ContentItem
Constructor and Description |
---|
StreamContentItem(String name,
ContentLocation parent,
WrappedInputStream inputStream,
WrappedOutputStream outputStream)
Creates a new stream-content item.
|
Modifier and Type | Method and Description |
---|---|
boolean |
delete()
Stream-repositories do not support the deletion of entries.
|
Object |
getAttribute(String domain,
String key)
Stream-Repositories do not support attributes.
|
Object |
getContentId()
Returns a unique identifier.
|
InputStream |
getInputStream()
Tries to open and return a input stream for reading from the content item.
|
String |
getMimeType()
Returns the mime type for the content entity.
|
String |
getName()
Returns the name of the entry.
|
OutputStream |
getOutputStream()
Tries to open and return a output stream for writing into the content item.
|
ContentLocation |
getParent()
Returns a reference to the parent location.
|
Repository |
getRepository()
Returns the current repository, to which tis entity belongs.
|
boolean |
isReadable()
Checks, whether the content item is readable.
|
boolean |
isWriteable()
Checks, whether the content item is writable.
|
boolean |
setAttribute(String domain,
String key,
Object value)
Stream-Repositories do not support attributes.
|
public StreamContentItem(String name, ContentLocation parent, WrappedInputStream inputStream, WrappedOutputStream outputStream)
name
- the name of the content item.parent
- the parent location.inputStream
- the (optional) input stream.outputStream
- the (optional) output stream.public boolean isReadable()
isReadable
in interface ContentItem
public boolean isWriteable()
isWriteable
in interface ContentItem
public String getMimeType() throws ContentIOException
getMimeType
in interface ContentItem
ContentIOException
- if an error occured.public OutputStream getOutputStream() throws ContentIOException, IOException
getOutputStream
in interface ContentItem
ContentIOException
- if an repository related error prevents the creation of the output stream.IOException
- if an IO error occurs.public InputStream getInputStream() throws ContentIOException, IOException
getInputStream
in interface ContentItem
ContentIOException
- if an repository related error prevents the creation of the input stream.IOException
- if an IO error occurs.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.