+

Search Tips   |   Advanced Search

 PREV CLASS   NEXT CLASS
Tree 
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

com.ibm.workplace.wcm.api
Interface Rendition

All Superinterfaces:
java.lang.Iterable<java.lang.String>
public interface Rendition
extends java.lang.Iterable<java.lang.String>

Represents a rendition for a DigitalAsset. A rendition may be any conversion/reduction/cropping/etc of a given asset into another form of the asset, including a thumbnail.

Renditions must have a non-null resource name.

Since:
v8.5.x

Method Summary
 byte[] getBytes()
          Return the contents of the resource contained within this rendition as a byte array.
 int getHeight()
          Get height of the rendition in pixels.
 java.io.InputStream getInputStream()
          Return the contents of the resource contained within this rendition as a input stream.
 java.lang.String getMimeType()
          Return the mime-type of the resource file.
 java.lang.String getProperty(java.lang.String property)
          Gets the property requested
 java.lang.String getRenditionName()
          Return the name of this rendition.
 java.lang.String getResourceName()
          Return the name of the resource contained within this rendition.
 java.lang.String getResourceURL()
          Return the server relative URL or Piece of Content (PoC) URI to the resource.
 long getSize()
          Return the size in bytes of the file contained within this component.
 int getWidth()
          Get width of the rendition in pixels.
 java.util.Iterator<java.lang.String> iterator()
          Get an iterator over all meta data property names of this asset.
 java.lang.String removeProperty(java.lang.String property)
          Removes the property.
 void setProperty(java.lang.String property, java.lang.String value)
          Sets the provided value to the property specified.
 

Method Detail

getRenditionName

java.lang.String getRenditionName()
                                  throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                                         com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the name of this rendition.

Returns:
the rendition name, not null
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have access to the resource
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the resource name cannot be retrieved

getResourceName

java.lang.String getResourceName()
                                 throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                                        com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the name of the resource contained within this rendition.

Returns:
the resource name, not null
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have access to the resource
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the resource name cannot be retrieved

getBytes

byte[] getBytes()
                throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                       com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the contents of the resource contained within this rendition as a byte array.

Returns:
the file content as a byte array
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have access to the file TODO: can that occur?
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the file cannot be retrieved

getInputStream

java.io.InputStream getInputStream()
                                   throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                                          com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the contents of the resource contained within this rendition as a input stream.

Returns:
the file content as a input stream
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have access to the file TODO: can that occur?
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the file cannot be retrieved or is externally managed

getMimeType

java.lang.String getMimeType()
Returns the mime-type of the resource file.

Returns null if no resource file has been set.

Returns:
the mime-type

getSize

long getSize()
             throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException,
                    com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns the size in bytes of the file contained within this component.

Returns -1 if a file has not been specified.

Returns:
the file size in bytes
Throws:
com.ibm.workplace.wcm.api.exceptions.AuthorizationException - if the user does not have access to the file
com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException - if the file cannot be retrieved

getResourceURL

java.lang.String getResourceURL()
Returns the server relative URL or Piece of Content (PoC) URI to the resource. A secure context URL will be returned if the current user is authenticated.

Returns null if no resource has been set.

Returns:
the server relative URL or PoC URI to the resource.

getWidth

int getWidth()
Get width of the rendition in pixels.

Returns:
width of the rendition in pixels, -1 if width is not available

getHeight

int getHeight()
Get height of the rendition in pixels.

Returns:
height of the rendition in pixels, -1 if width is not available

setProperty

void setProperty(java.lang.String property,
                 java.lang.String value)
                 throws java.lang.IllegalArgumentException
Sets the provided value to the property specified. If a property with the same name already exists the value will get replaced with the new value. If the value is null it has the same effect as removing the property.

Parameters:
property - - the property name, not null
value - - the property value
Throws:
java.lang.IllegalArgumentException - if property name is null

getProperty

java.lang.String getProperty(java.lang.String property)
                             throws java.lang.IllegalArgumentException
Gets the property requested

Parameters:
property - - the property name, not null
Returns:
the property value
Throws:
java.lang.IllegalArgumentException - if property name is null

removeProperty

java.lang.String removeProperty(java.lang.String property)
                                throws java.lang.IllegalArgumentException
Removes the property.

Parameters:
property - - the property name, not null
Returns:
the property value removed, null if property was not found/
Throws:
java.lang.IllegalArgumentException - if property name is null

iterator

java.util.Iterator<java.lang.String> iterator()
Get an iterator over all meta data property names of this asset.

Specified by:
iterator in interface java.lang.Iterable<java.lang.String>
Returns:
iterator over all meta data property names of this asset.
 PREV CLASS   NEXT CLASS
Tree 
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD