org.alfresco.repo.jscript
Class ScriptNode.ScriptContentData

java.lang.Object
  extended by org.alfresco.repo.jscript.ScriptNode.ScriptContentData
All Implemented Interfaces:
java.io.Serializable, org.springframework.extensions.surf.util.Content
Enclosing class:
ScriptNode

public class ScriptNode.ScriptContentData
extends java.lang.Object
implements org.springframework.extensions.surf.util.Content, java.io.Serializable

Inner class wrapping and providing access to a ContentData property

See Also:
Serialized Form

Constructor Summary
ScriptNode.ScriptContentData(org.alfresco.service.cmr.repository.ContentData contentData, org.alfresco.service.namespace.QName property)
          Constructor
 
Method Summary
 void delete()
          Delete the content stream
 java.lang.String getContent()
           
 java.lang.String getDownloadUrl()
           
 java.lang.String getEncoding()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getMimetype()
           
 java.io.Reader getReader()
           
 long getSize()
           
 java.lang.String getUrl()
           
 void guessEncoding()
          Guess the character encoding of a file.
 void guessMimetype(java.lang.String filename)
          Guess the mimetype for the given filename - uses the extension to match on system mimetype map
 void setContent(java.lang.String content)
          Set the content stream
 void setEncoding(java.lang.String encoding)
           
 void setMimetype(java.lang.String mimetype)
           
 void write(org.springframework.extensions.surf.util.Content content)
          Set the content stream from another content object
 void write(java.io.InputStream inputStream)
          Set the content stream from another input stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptNode.ScriptContentData

public ScriptNode.ScriptContentData(org.alfresco.service.cmr.repository.ContentData contentData,
                                    org.alfresco.service.namespace.QName property)
Constructor

Parameters:
contentData - The ContentData object this object wraps
property - The property the ContentData is attached too
Method Detail

getContent

public java.lang.String getContent()
Specified by:
getContent in interface org.springframework.extensions.surf.util.Content

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in interface org.springframework.extensions.surf.util.Content

getReader

public java.io.Reader getReader()
Specified by:
getReader in interface org.springframework.extensions.surf.util.Content

setContent

public void setContent(java.lang.String content)
Set the content stream

Parameters:
content - Content string to set

write

public void write(org.springframework.extensions.surf.util.Content content)
Set the content stream from another content object

Parameters:
content - ScriptContent to set

write

public void write(java.io.InputStream inputStream)
Set the content stream from another input stream

Parameters:
inputStream -

delete

public void delete()
Delete the content stream


getUrl

public java.lang.String getUrl()
Returns:
download URL to the content

getDownloadUrl

public java.lang.String getDownloadUrl()
Returns:
download URL to the content for a document item only

getSize

public long getSize()
Specified by:
getSize in interface org.springframework.extensions.surf.util.Content

getMimetype

public java.lang.String getMimetype()
Specified by:
getMimetype in interface org.springframework.extensions.surf.util.Content

getEncoding

public java.lang.String getEncoding()
Specified by:
getEncoding in interface org.springframework.extensions.surf.util.Content

setEncoding

public void setEncoding(java.lang.String encoding)

setMimetype

public void setMimetype(java.lang.String mimetype)

guessMimetype

public void guessMimetype(java.lang.String filename)
Guess the mimetype for the given filename - uses the extension to match on system mimetype map


guessEncoding

public void guessEncoding()
Guess the character encoding of a file. For non-text files UTF-8 default is applied, otherwise the appropriate encoding (such as UTF-16 or similar) will be appiled if detected.



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.