Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Core Repository Services
Back to Main Page > Specification > Content Service
/**
* Gets the content associated with a node. The content is returned as an InputStream.
* If the referenced node does not have any content associated with it then a null
* stream is returned.
*
* @param nodeReference - a node reference
* @return an input stream containing the content of the referenced node or null if none
* available.
*/
public InputStream getContent(NodeReference nodeReference);
/**
* Gets the content associated with a node. The content is returned as a reference to a file.
* If the referenced node does not have any content associated with it then the file will be empty.
*
* @param nodeReference - a node reference
* @param file - a file reference
* @return void
*/
public void getContentAsFile(NodeReference nodeReference, File file);
/**
* Gets the content associated with a node. The content is returned as a string.
* If the referenced node does not have any content associatied with it then a null string is returned.
*
* @param nodeReference - a node reference
* @return a string containing the content, null if none available
*/
public String getContentAsString(NodeReference nodeReference);
/**
* Sets the content on the referenced node. The content is passes as an InputStream.
* Any exisiting content is overriden.
*
* @param nodeReference - a node reference
* @param inputStream - input stream containing the nodes content
*/
public void setContent(NodeReference nodeReference, InputStream inputStream);
/**
* Sets the content on the referenced node. The content is taken from the contents of
* the passed file. Any exisiting content is overriden.
*
* @param nodeReference - a node reference
* @param file - the file to take the content from
*/
public void setContent(NodeReference nodeReference, File file);
/**
* Sets the content on the referenced node. The content is passed as a string.
* Any exisiting content is overriden.
*
* @param nodeReference - a node reference
* @param string - the stirng containing the content
*/
public void setContent(NodeReference nodeReference, String string);
/**
* Indicates whether the referenced node has any content set.
*
* @param nodeReference - a node reference
* @return true if the referenced node has content set, false otherwise
*/
public boolean hasContent(NodeReference nodeReference);