|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Resource
Interface to represent a resource.
Method Summary | |
---|---|
void |
addAspect(String name)
Method to add an aspect. |
void |
addProperty(String key,
String value)
Add a property value for the provided key. |
void |
discard()
Method to discard the resource |
void |
editPropertyValue(String key,
String oldValue,
String newValue)
Edit property value. |
List<String> |
getAspects()
Get the aspects associated with the resource. |
String |
getAuthorUserName()
Get the user name of the resource author. |
Object |
getContent()
Method to get the content of the resource. |
InputStream |
getContentStream()
Method to get the content stream. |
Date |
getCreatedTime()
Method to get the created time. |
String |
getDescription()
Method to get the description. |
String |
getId()
The Resource ID, In the default implementation this returns the path. |
Date |
getLastModified()
Method to get the last modified date. |
String |
getLastUpdaterUserName()
Method to get the last updated user name. |
String |
getMediaType()
Get media type. |
String |
getParentPath()
Get the parent path. |
String |
getPath()
Method to get the path. |
String |
getPermanentPath()
If resource is version-ed, the associated version of the resource does not get modified by any means. |
Properties |
getProperties()
Returns all properties of the resource. |
String |
getProperty(String key)
Get the property value for the given key, if there are multiple value for that key, it will return the first value. |
List<String> |
getPropertyValues(String key)
Returns the list of values for the given property name. |
int |
getState()
Method to get the state. |
boolean |
isVersionableChange()
Check whether there are any changes that need to make a version |
void |
removeAspect(String name)
Method to remove an aspect. |
void |
removeProperty(String key)
Remove property. |
void |
removePropertyValue(String key,
String value)
Remove property value. |
void |
setContent(Object content)
Set the content of the resource. |
void |
setContentStream(InputStream contentStream)
Method to set the content stream. |
void |
setDescription(String description)
Method to set the description. |
void |
setMediaType(String mediaType)
Set media type. |
void |
setProperties(Properties properties)
Set properties. |
void |
setProperty(String key,
List<String> value)
Set a property with multiple value. |
void |
setProperty(String key,
String value)
Set a property with single value. |
void |
setVersionableChange(boolean versionableChange)
Method to set whether there are any changes that need to make a version |
Method Detail |
---|
String getId()
getId
in interface org.wso2.carbon.registry.api.Resource
String getAuthorUserName()
getAuthorUserName
in interface org.wso2.carbon.registry.api.Resource
Date getCreatedTime()
getCreatedTime
in interface org.wso2.carbon.registry.api.Resource
Date getLastModified()
getLastModified
in interface org.wso2.carbon.registry.api.Resource
String getDescription()
getDescription
in interface org.wso2.carbon.registry.api.Resource
void setDescription(String description)
setDescription
in interface org.wso2.carbon.registry.api.Resource
description
- the description.String getPath()
getPath
in interface org.wso2.carbon.registry.api.Resource
String getPermanentPath()
getPermanentPath
in interface org.wso2.carbon.registry.api.Resource
String getMediaType()
getMediaType
in interface org.wso2.carbon.registry.api.Resource
int getState()
getState
in interface org.wso2.carbon.registry.api.Resource
void setMediaType(String mediaType)
setMediaType
in interface org.wso2.carbon.registry.api.Resource
mediaType
- the media type.String getParentPath()
getParentPath
in interface org.wso2.carbon.registry.api.Resource
String getProperty(String key)
getProperty
in interface org.wso2.carbon.registry.api.Resource
key
- the property key.
List<String> getPropertyValues(String key)
getPropertyValues
in interface org.wso2.carbon.registry.api.Resource
key
- Key of the property.
Properties getProperties()
getProperties
in interface org.wso2.carbon.registry.api.Resource
void setProperty(String key, String value)
setProperty
in interface org.wso2.carbon.registry.api.Resource
key
- the property key.value
- the property value.void setProperty(String key, List<String> value)
setProperty
in interface org.wso2.carbon.registry.api.Resource
key
- the property key.value
- the property values.void addProperty(String key, String value)
addProperty
in interface org.wso2.carbon.registry.api.Resource
key
- the property key.value
- the property value.void setProperties(Properties properties)
setProperties
in interface org.wso2.carbon.registry.api.Resource
properties
- the properties.void editPropertyValue(String key, String oldValue, String newValue)
editPropertyValue
in interface org.wso2.carbon.registry.api.Resource
key
- the key.oldValue
- the old value.newValue
- the new value.void removeProperty(String key)
removeProperty
in interface org.wso2.carbon.registry.api.Resource
key
- the property key.void removePropertyValue(String key, String value)
removePropertyValue
in interface org.wso2.carbon.registry.api.Resource
key
- the property key.value
- the property value.Object getContent() throws RegistryException
getContent
in interface org.wso2.carbon.registry.api.Resource
RegistryException
- throws if the operation fail.void setContent(Object content) throws RegistryException
setContent
in interface org.wso2.carbon.registry.api.Resource
content
- the resource.
RegistryException
- throws if the operation fail.String getLastUpdaterUserName()
getLastUpdaterUserName
in interface org.wso2.carbon.registry.api.Resource
InputStream getContentStream() throws RegistryException
getContentStream
in interface org.wso2.carbon.registry.api.Resource
RegistryException
- throws if the operation fail.void setContentStream(InputStream contentStream) throws RegistryException
setContentStream
in interface org.wso2.carbon.registry.api.Resource
contentStream
- the content stream to set.
RegistryException
- throws if the operation fail.List<String> getAspects()
getAspects
in interface org.wso2.carbon.registry.api.Resource
void addAspect(String name)
addAspect
in interface org.wso2.carbon.registry.api.Resource
name
- the name of the aspect.void removeAspect(String name)
removeAspect
in interface org.wso2.carbon.registry.api.Resource
name
- the name of the aspect to remove.void discard()
discard
in interface org.wso2.carbon.registry.api.Resource
boolean isVersionableChange()
void setVersionableChange(boolean versionableChange)
versionableChange
- whether version-able change is made or not.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |