public final class LocalContentStream extends Object implements ContentStreamSerializer
CONTENTTYPE_CONTENTROWREF, CONTENTTYPE_COPIEDCONTENT, CONTENTTYPE_EMPTY, CONTENTTYPE_PATH, CONTENTTYPE_READER, CONTENTTYPE_REFERENCE, CONTENTTYPE_SHAREDCONTENT, CONTENTTYPE_STREAM, CONTENTTYPE_STRING, CONTENTTYPE_UNKNOWN
Constructor and Description |
---|
LocalContentStream()
Constructs a LocalContentStream.
|
Modifier and Type | Method and Description |
---|---|
Reader |
getContentReader()
Get the content as a reader.
|
String |
getContentReference()
Gets the content as a string reference that is interpreted by the Media
instance.
|
Long |
getContentRowReference()
Get the content as a content row ID reference.
|
InputStream |
getContentStream()
Get the content as a stream.
|
String |
getContentString()
Get the content as an explicit String.
|
int |
getContentType()
Get the content type.
|
AttributeValue |
getCopiedContent()
Get the content as an AttributeValue reference to another
ContentObject.
|
String |
getLocalContentPath()
Get the content as a path to a file in the local file system.
|
AttributeValue |
getSharedContent()
Get the content as an AttributeValue reference to another
ContentObject.
|
void |
setContentReader(Reader content)
Set the content as a Reader.
|
void |
setContentReference(LibrarySessionInterface session,
String contentReference)
Sets the content as a string reference that is interpreted by the Media
instance.
|
void |
setContentRowReference(LibrarySessionInterface session,
Long content)
Set the content as a content row ID reference.
|
void |
setContentStream(InputStream content)
Set the content as a stream.
|
void |
setContentString(String content)
Set the content as an explicit String.
|
void |
setCopiedContent(AttributeValue content)
Set the content as an AttributeValue reference to another
ContentObject.
|
void |
setEmptyContent()
Set the content explicitly as "empty content".
|
void |
setLocalContentPath(String path)
Set the content as a path to a file in the local file system.
|
void |
setSharedContent(AttributeValue content)
Set the content as an AttributeValue reference to another
ContentObject.
|
public LocalContentStream()
The initial content type is CONTENTTYPE_UNKNOWN
public int getContentType()
Must be one of the valid Content type constants defined in this interface.
getContentType
in interface ContentStreamSerializer
public void setEmptyContent()
setEmptyContent
in interface ContentStreamSerializer
public InputStream getContentStream() throws IfsException
getContentStream
in interface ContentStreamSerializer
IfsException
public void setContentStream(InputStream content)
setContentStream
in interface ContentStreamSerializer
content
- the content as a streampublic Reader getContentReader()
getContentReader
in interface ContentStreamSerializer
public void setContentReader(Reader content)
setContentReader
in interface ContentStreamSerializer
content
- the content as a Readerpublic String getContentString()
getContentString
in interface ContentStreamSerializer
public void setContentString(String content) throws IfsException
setContentString
in interface ContentStreamSerializer
content
- the content as a StringIfsException
public String getLocalContentPath()
getLocalContentPath
in interface ContentStreamSerializer
public void setLocalContentPath(String path) throws IfsException
setLocalContentPath
in interface ContentStreamSerializer
path
- the content as a local file pathIfsException
public AttributeValue getCopiedContent()
getCopiedContent
in interface ContentStreamSerializer
public void setCopiedContent(AttributeValue content)
setCopiedContent
in interface ContentStreamSerializer
content
- the content as ContentObject valuepublic AttributeValue getSharedContent()
getSharedContent
in interface ContentStreamSerializer
public void setSharedContent(AttributeValue content)
setSharedContent
in interface ContentStreamSerializer
content
- the content as ContentObject valuepublic Long getContentRowReference()
getContentRowReference
in interface ContentStreamSerializer
public void setContentRowReference(LibrarySessionInterface session, Long content) throws IfsException
This operation requires administration mode.
setContentRowReference
in interface ContentStreamSerializer
session
- a session; must be in admin modecontent
- the content as a content row ID reference.IfsException
public String getContentReference() throws IfsException
getContentReference
in interface ContentStreamSerializer
IfsException
- if the operation failspublic void setContentReference(LibrarySessionInterface session, String contentReference) throws IfsException
This operation requires administration mode.
setContentReference
in interface ContentStreamSerializer
session
- a session; must be in admin modecontentReference
- the content referenceIfsException
- if the operation failsCopyright © 2023. All rights reserved.