Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Interface Image

All Superinterfaces:
JiveObject

public interface Image
extends JiveObject

An object that encapsulates an image. Each image has a unique ID and is made up of three parts: binary data (read and written using an InputStream), a name, and content type. An image might have a name "stockchart.gif" and corresponding content type of "image/gif".

The storage mechanism of images is controlled via the StorageManager; the default implementation puts images in the database.


Method Summary
 String getContentType()
          Returns the content type of the image.
 Date getCreationDate()
          Returns the date the image was created.
 InputStream getData()
          Returns a InputStream for the binary contents of the image.
 JiveContentObject getJiveContentObject()
          Returns the parent JiveContentObject of the image.
 Date getModificationDate()
          Returns the date the image was last modified.
 String getName()
          Returns the name of the image.
 int getSize()
          Returns the size of the image in bytes.
 void setName(String name)
          Sets the name of the image.
 
Methods inherited from interface com.jivesoftware.community.JiveObject
getID, getObjectType
 

Method Detail

getJiveContentObject

JiveContentObject getJiveContentObject()
Returns the parent JiveContentObject of the image.

Returns:
the parent JiveContentObject which contains the image.

getContentType

String getContentType()
Returns the content type of the image. For example, the content type might be "image/gif" or "image/jpeg".

Returns:
the image content type.

getName

String getName()
Returns the name of the image. Most often, the image name is the original name of the file that created the image, such as "logo.gif"

Returns:
the name of the image.

setName

void setName(String name)
             throws UnauthorizedException
Sets the name of the image. Most often, the image name is the original name of the file that created the image, such as "logo.gif"

Parameters:
name - the new name of the image.
Throws:
UnauthorizedException - if not allowed to modify the image

getSize

int getSize()
Returns the size of the image in bytes.

Returns:
the size of the image.

getData

InputStream getData()
                    throws IOException
Returns a InputStream for the binary contents of the image. The stream should be closed after reading the image is completed. The InputStream will already be buffered, so there is no advantage to using additional buffering.

Returns:
the binary contents of the image.
Throws:
IOException - if an error occurs reading the image from storage.

getCreationDate

Date getCreationDate()
Returns the date the image was created.

Returns:
the date the image was created.

getModificationDate

Date getModificationDate()
Returns the date the image was last modified.

Returns:
the date the image was last modified.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.