Interface IContentItem
- All Superinterfaces:
IMimeTypeListener
Construction of a new ContentItem is managed by ContentLocation.newContentItem. This is because there is a
parent-child relationship between ContentLocations and content items. To avoid having a content item reach back
into it's parent to add itself to the children list, you instead call the content location to construct a
content item. A content item cannot exist without a content location.
- Author:
- mbatchel
- See Also:
-
ContentLocation
-
Method Summary
Modifier and TypeMethodDescriptionvoid
org.pentaho.commons.connection.IPentahoStreamSource
Gets an input stream from the Content item.getOutputStream
(String actionName) The behavior of this method depends upon it's write mode (defined only at construction).getPath()
void
setMimeType
(String mimeType) Sets the mime typeMethods inherited from interface org.pentaho.platform.api.engine.IMimeTypeListener
setName
-
Method Details
-
getPath
String getPath()- Returns:
- The ContentItem path
-
getMimeType
String getMimeType()- Returns:
- The MimeType of the content item.
-
getInputStream
Gets an input stream from the Content item. If the content item doesn't exist on disk, throws an exception- Returns:
- An input stream from the file system that is represented by this content item
- Throws:
ContentException
-
getDataSource
org.pentaho.commons.connection.IPentahoStreamSource getDataSource() -
getOutputStream
The behavior of this method depends upon it's write mode (defined only at construction). If the write mode is WRITEMODE_KEEPVERSIONS, this method will create a new file on the disk, and add it to it's internal list of files, and return an output stream. If the write mode is WRITEMODE_OVERWRITE, this method will create an output stream and overwrite the existing file on the disk if it's found, or will create the file if it doesn't exist. If the write mode is WRITEMODE_APPEND, this method will append to the existing file on disk (if it exists), or create it if it doesn't exist.- Parameters:
actionName
- The name of the action that is obtaining the output stream.- Returns:
- the OutputStream to write to
- Throws:
IOException
-
closeOutputStream
void closeOutputStream() -
setMimeType
Sets the mime type- Specified by:
setMimeType
in interfaceIMimeTypeListener
- Parameters:
mimeType
- The mime type to set.
-