|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Resource
Interface representing a binary resource, like an image or a file.
Method Summary | |
---|---|
byte[] |
getBytes()
Returns the contents of the resource uploaded within this component as a byte array. |
java.io.InputStream |
getInputStream()
Returns the contents of the resource uploaded within this component as a input stream. |
java.lang.String |
getMimeType()
Returns the mime-type of the resource file uploaded within this component. |
java.lang.String |
getResourceName()
Returns the name of the resource uploaded within this component. |
java.lang.String |
getResourceURL()
Returns the server relative URL or Piece of Content (PoC) URI to the resource. |
long |
getSize()
Returns the size in bytes of the file uploaded within this component. |
void |
removeResource()
Removes the resource file uploaded within this component. |
void |
setDeliverableOverCachingNetworkSupport(boolean deliveryOverCachingNetwork)
Sets a flag indicating the asset should be delivery over a caching network if available. |
void |
setResource(java.lang.String resourceName,
byte[] resourceBytes)
Sets the resource file uploaded within this component. |
void |
setResource(java.lang.String resourceName,
java.io.File resourceFile)
Sets the resource file uploaded within this component. |
boolean |
supportsDeliveryOverCachingNetwork()
Returns true if the asset can be delivery over a caching network if available. |
Method Detail |
---|
java.lang.String getResourceName() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns null if a resource name has not been specified.
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 retrievedbyte[] getBytes() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
May return an empty byte array if the byte content could not be retrieved.
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 or is externally managedjava.io.InputStream getInputStream() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns an empty byte array if no file has been set or the byte content could not be retrieved.
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 or is externally managedvoid setResource(java.lang.String resourceName, byte[] resourceBytes) throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
This method does not accept null arguments. Passing a
null argument into this method will result in a
NullPointerException
.
resourceName
- the filename of the resource fileresourceBytes
- the content of the resource file as a byte array
java.lang.NullPointerException
- if either of the arguments resourceName or
resource are null
com.ibm.workplace.wcm.api.exceptions.OperationFailedException
- if the resource file could not be setvoid setResource(java.lang.String resourceName, java.io.File resourceFile) throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
This method does not accept null arguments. Passing a
null argument into this method will result in a
NullPointerException
.
resourceName
- the filename of the resource fileresourceFile
- the contents of the resource as a file on the file system
java.lang.NullPointerException
- if either of the arguments resourceName or
resource are null
com.ibm.workplace.wcm.api.exceptions.OperationFailedException
- if the resource file could not be setvoid removeResource() throws com.ibm.workplace.wcm.api.exceptions.OperationFailedException
com.ibm.workplace.wcm.api.exceptions.OperationFailedException
- if an error occurred removing the resource file.java.lang.String getMimeType()
Returns null if no resource file has been set.
long getSize() throws com.ibm.workplace.wcm.api.exceptions.AuthorizationException, com.ibm.workplace.wcm.api.exceptions.PropertyRetrievalException
Returns -1 if a file has not been specified.
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 retrievedjava.lang.String getResourceURL()
Returns null if no resource has been set.
boolean supportsDeliveryOverCachingNetwork()
void setDeliverableOverCachingNetworkSupport(boolean deliveryOverCachingNetwork)
deliveryOverCachingNetwork
- should asset be delivered via caching network?
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |