public class ScriptNode.ScriptContentData extends Object implements org.springframework.extensions.surf.util.Content, Serializable
| Constructor and Description |
|---|
ScriptContentData(org.alfresco.service.cmr.repository.ContentData contentData,
org.alfresco.service.namespace.QName property)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Delete the content stream
|
String |
getContent() |
String |
getDownloadUrl() |
String |
getEncoding() |
InputStream |
getInputStream() |
String |
getMimetype() |
Reader |
getReader() |
long |
getSize() |
String |
getUrl() |
void |
guessEncoding()
Guess the character encoding of a file.
|
void |
guessMimetype(String filename)
Guess the mimetype for the given filename - uses the extension to match on system mimetype map
|
boolean |
isDirty() |
void |
setContent(String content)
Set the content stream
|
void |
setEncoding(String encoding) |
void |
setMimetype(String mimetype) |
void |
write(org.springframework.extensions.surf.util.Content content)
Set the content stream from another content object.
|
void |
write(org.springframework.extensions.surf.util.Content content,
boolean applyMimetype,
boolean guessEncoding)
Set the content stream from another content object.
|
void |
write(InputStream inputStream)
Set the content stream from another input stream.
|
public ScriptContentData(org.alfresco.service.cmr.repository.ContentData contentData,
org.alfresco.service.namespace.QName property)
contentData - The ContentData object this object wrapsproperty - The property the ContentData is attached toopublic String getContent()
getContent in interface org.springframework.extensions.surf.util.Contentpublic InputStream getInputStream()
getInputStream in interface org.springframework.extensions.surf.util.Contentpublic Reader getReader()
getReader in interface org.springframework.extensions.surf.util.Contentpublic boolean isDirty()
true if the contentData has a binary (content URL) associated and the updates on contentData and related properties should be saved.
false if the contentData has a temporary value and no actual binary to be persisted.public void setContent(String content)
content - Content string to setpublic void write(org.springframework.extensions.surf.util.Content content)
content - ScriptContent to setpublic void write(org.springframework.extensions.surf.util.Content content,
boolean applyMimetype,
boolean guessEncoding)
content - ScriptContent to setapplyMimetype - If true, apply the mimetype from the Content object, else leave the original mimetypeguessEncoding - If true, guess the encoding from the underlying input stream, else use encoding set in
the Content object as supplied.public void write(InputStream inputStream)
inputStream - InputStreampublic void delete()
public String getUrl()
public String getDownloadUrl()
public long getSize()
getSize in interface org.springframework.extensions.surf.util.Contentpublic String getMimetype()
getMimetype in interface org.springframework.extensions.surf.util.Contentpublic String getEncoding()
getEncoding in interface org.springframework.extensions.surf.util.Contentpublic void setEncoding(String encoding)
public void setMimetype(String mimetype)
public void guessMimetype(String filename)
public void guessEncoding()
Copyright © 2005–2018 Alfresco Software. All rights reserved.