public class ResourceUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
IResource |
createOrUpdateResource(IResourceContext resContext,
ICollection c,
String name,
IContent content,
IPropertyMap props)
Create a resource, or update its content and properties, if it exists
|
IResource |
createOrUpdateResource(IResourceContext resContext,
RID rid,
IContent content,
IPropertyMap props)
Create a resource, or update its content and properties, if it exists
|
IResource |
createOrUpdateResource(IResourceContext resContext,
String uri,
IContent content,
IPropertyMap props)
Create a resource, or update its content and properties, if it exists
|
IResource |
createOrUpdateResourceWithPropertyErrors(IResourceContext resContext,
ICollection c,
String name,
IContent content,
IPropertyMap props)
Creates a resource, or update its content and properties, if it exists.
|
IResource |
createOrUpdateResourceWithPropertyErrors(IResourceContext resContext,
RID rid,
IContent content,
IPropertyMap props)
Creates a resource, or update its content and properties, if it exists.
|
IResource |
createOrUpdateResourceWithPropertyErrors(IResourceContext resContext,
String uri,
IContent content,
IPropertyMap props)
Creates a resource, or update its content and properties, if it exists.
|
IResource |
createResource(ICollection c,
String name,
IContent content,
IPropertyMap props,
IResourceContext resContext)
Create a resource
|
IResource |
createResource(IResourceContext resContext,
RID rid,
IContent content,
IPropertyMap props)
Create a resource
|
IResource |
createResource(IResourceContext resContext,
String uri,
IContent content,
IPropertyMap props)
Create a resource
|
boolean |
existsResource(IResourceContext resContext,
RID rid)
Checks if a resource exists
|
boolean |
existsResource(IResourceContext resContext,
String uri)
Checks if a resource exists
|
ICollection |
getCollection(IResourceContext resContext,
RID rid)
Get a collection by its RID.
|
static ResourceUtils |
getInstance() |
IResource |
getResource(IResourceContext resContext,
RID rid)
Get a resource by its RID
|
IResource |
getResource(IResourceContext resContext,
String uri)
Get a resource by its URI
|
IResource |
getResource(RID rid)
Get a resource by its RID with the service context
|
IResource |
getResource(String uri)
Get a resource by its URI with the service context
|
IResourceFactory |
getResourceFactory()
Get a shared resource factory instance
|
IResource |
getResourceNoException(IResourceContext resContext,
RID rid)
Get a resource by its RID, but do not throw an exception in error case
|
IResource |
getResourceNoException(IResourceContext resContext,
String uri)
Get a resource by its URI, but do not throw an exception in error case
|
IResource |
getResourceNoException(RID rid)
Get a resource by its RID with the service context, but do not throw an exception in error case
|
IResource |
getResourceNoException(String uri)
Get a resource by its URI with the service context, but do not throw an exception in error case
|
IResourceContext |
getServiceContext()
Gets service context
|
InputStream |
getUnfilteredContentStream(IResource res)
Returns the content of this resource as a stream
|
IResource |
updateResource(IResource resource,
IContent content,
IPropertyMap props)
Update content and properties of an existing resource
|
public static ResourceUtils getInstance() throws XFException
XFExceptionpublic IResourceFactory getResourceFactory()
public IResource getResource(String uri) throws XFException
uri - the resource URIIResource, or null, if the resource does not existXFException - if there is a problem to get a resource with the provided uripublic IResource getResource(RID rid) throws XFException
rid - the resource RIDIResource, or null, if the resource does not existXFException - if there is a problem to get a resource with the provided ridpublic IResource getResource(IResourceContext resContext, String uri) throws XFException
resContext - the context to useuri - the resource URIIResource, or null, if the resource does not existXFException - if there is a problem to get a resource with the provided uri, e.g. access denied to this resource or locked resource.public IResource getResource(IResourceContext resContext, RID rid) throws XFException
resContext - the context to userid - the resource RIDIResource, or null, if the resource does not existXFException - if there is a problem to get a resource with the provided uri, e.g. access denied to this resource or locked resource.public ICollection getCollection(IResourceContext resContext, RID rid) throws XFException
resContext - the context to userid - the collection RIDICollection representing the collectionXFException - if there is a problem to get a collection with the provided rid, e.g. access denied to this collection, collection is locked or the provided rid is not a collection rid.public boolean existsResource(IResourceContext resContext, String uri) throws XFException
resContext - the context to useuri - the resource URItrue, if the resource exists, false otherwiseXFException - if there is a problem to get a resource with the provided uripublic boolean existsResource(IResourceContext resContext, RID rid) throws XFException
resContext - the context to userid - the resource RIDtrue, if the resource exists, false otherwiseXFException - in case there is a problem to get a resource with the provided ridpublic IResource getResourceNoException(IResourceContext resContext, String uri)
resContext - the context to useuri - the resource URIIResource, or null, if the resource does not exist,
or if an error occurredpublic IResource getResourceNoException(IResourceContext resContext, RID rid)
resContext - the context to userid - the resource RIDIResource, or null, if the resource does not exist,
or if an error occurredpublic IResource getResourceNoException(String uri)
uri - the resource URIIResource, or null, if the resource does not exist,
or if an error occurredpublic IResource getResourceNoException(RID rid)
rid - the resource RIDIResource, or null, if the resource does not exist,
or if an error occurredpublic IResource createResource(ICollection c, String name, IContent content, IPropertyMap props, IResourceContext resContext) throws XFException
c - the parent collectionname - the name of the new resourcecontent - the content of the new resourceprops - the resource propertiesresContext - the context to useXFException - in case there is a problem to create a resource in the provided collection with the provided name
or access denied to the provided collectionpublic IResource createResource(IResourceContext resContext, String uri, IContent content, IPropertyMap props) throws XFException
resContext - the context to useuri - the URI of the new resourcecontent - the content of the new resourceprops - the resource propertiesXFException - if there is a problem to create a resource with the provided uripublic IResource createResource(IResourceContext resContext, RID rid, IContent content, IPropertyMap props) throws XFException
resContext - the context to userid - the RID of the new resourcecontent - the content of the new resourceprops - the resource propertiesXFException - there is a problem to create a resource with the provided ridpublic IResource createOrUpdateResource(IResourceContext resContext, ICollection c, String name, IContent content, IPropertyMap props) throws XFException
resContext - the context to usec - the parent collectionname - the new or existing resource namecontent - the new resource contentprops - the new resource propertiesXFException - if cannot get RID of parent collection or if there is a problem to create/update a resource with the provided namepublic IResource createOrUpdateResource(IResourceContext resContext, RID rid, IContent content, IPropertyMap props) throws XFException
resContext - the context to userid - the RID of the new or existing resourcecontent - the new resource contentprops - the new resource propertiesXFException - if there is a problem to get, create or update a resource with the provided ridpublic IResource createOrUpdateResource(IResourceContext resContext, String uri, IContent content, IPropertyMap props) throws XFException
resContext - the context to useuri - the URI of the new or existing resourcecontent - the new resource contentprops - the new resource propertiesXFException - if there is a problem to get, create or update a resource with the provided ridpublic IResource updateResource(IResource resource, IContent content, IPropertyMap props) throws XFException
resource - the resource to updatecontent - the new resource contentprops - the new resource properties.XFException - if there is a problem to get resource properties, e.g. get properties not supported or access denied to this resource, or resource is locked.public InputStream getUnfilteredContentStream(IResource res) throws XFException
res - handle to the resourceInputStream to unfiltered resource contentXFException - if there is a problem to get a resource content of the provided resource, e.g. the resource has not content, access denied or resource is locked.public IResourceContext getServiceContext() throws XFException
XFException - If cannot get service contextpublic IResource createOrUpdateResourceWithPropertyErrors(IResourceContext resContext, ICollection c, String name, IContent content, IPropertyMap props) throws XFException, AbstractPropertyException, SetPropertiesException
resContext - the context to usec - the parent collectionname - the new or existing resource namecontent - the new resource contentprops - the new resource propertiesXFException - in case there is a problem to get, create or update a resource with the provided nameAbstractPropertyException - in case there is a problem to get, create or update a resource with the provided nameSetPropertiesException - in case there is a problem to get, create or update a resource with the provided namepublic IResource createOrUpdateResourceWithPropertyErrors(IResourceContext resContext, RID rid, IContent content, IPropertyMap props) throws XFException, AbstractPropertyException, SetPropertiesException
resContext - the context to userid - the RID of the new or existing resourcecontent - the new resource contentprops - the new resource propertiesXFException - in case there is a problem to get, create or update a resource with the provided ridAbstractPropertyException - in case there is a problem to get, create or update a resource with the provided ridSetPropertiesException - in case there is a problem to get, create or update a resource with the provided ridpublic IResource createOrUpdateResourceWithPropertyErrors(IResourceContext resContext, String uri, IContent content, IPropertyMap props) throws XFException, AbstractPropertyException, SetPropertiesException
resContext - the context to useuri - the URI of the new or existing resourcecontent - the new resource contentprops - the new resource propertiesXFException - in case there is a problem to get, create or update a resource with the provided uriAbstractPropertyException - in case there is a problem to get, create or update a resource with the provided uriSetPropertiesException - in case there is a problem to get, create or update a resource with the provided uri| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice