Package eu.xenit.alfred.api.content
Interface IContentService
public interface IContentService
Created by jasper on 25/10/17.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontentUrlExists(String contentUrl) Checks if the content url exists.createContent(InputStream inputStream, String mimeType, String encoding) Creates a content without linking it to a specific node yet.getContent(NodeRef node) Returns content as inputStream + other related informations (mimeType, size, ...)voidsetContent(NodeRef node, InputStream inputStream, String originalFilename) Sets content of a specific node.
-
Method Details
-
contentUrlExists
Checks if the content url exists.- Parameters:
contentUrl- The content url to check.- Returns:
- true if exists, false otherwise
-
setContent
Sets content of a specific node. Also changes mimetype by guessing it via the original file name.- Parameters:
node- NodeRef of the node where the content of the inputStream will placed.inputStream- The input stream that contains the content. In case the input stream is null the content will be set to empty.originalFilename- The filename of the content. This is only used to guess the mimetype of the node.
-
createContent
Creates a content without linking it to a specific node yet.- Parameters:
inputStream- Can be null: in that case, the content property of the file is remove.mimeType- ex: "application/pdf"encoding- ex: "UTF-8", ....- Returns:
- the URL of the content (can be set to the content property of a node).
-
getContent
Returns content as inputStream + other related informations (mimeType, size, ...)- Parameters:
node- NodeRef from where the content will be gathered.- Returns:
- ContentInputStream.inputStream has to be closed!
-