public class DOMResourceHelper extends Object
Copyright 2004 SAP AG
| Constructor and Description |
|---|
DOMResourceHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
makeFilename(String id)
Creates a valid filename from an arbitrary id string.
|
static Document |
read(IResource resource)
Reads the specified XML resource into a DOM representation.
|
static Document |
read(String uri,
IResourceContext context)
Reads the specified XML resource into a DOM representation.
|
static byte[] |
serialize(Document document)
Serializes the specified DOM representation into a byte array.
|
static byte[] |
serialize(IDOMStorable storable)
Serializes the specified
IDOMStorable object into a byte array. |
static void |
write(IResource resource,
Document document)
Writes the specified DOM representation to the specified XML resource.
|
static void |
write(IResource resource,
IDOMStorable storable)
Writes the specified DOM representation to the specified XML resource.
|
static void |
write(String uri,
Document document,
IResourceContext context)
Writes the specified DOM representation to the specified XML resource.
|
static void |
write(String uri,
IDOMStorable storable,
IResourceContext context)
Writes the specified DOM representation to the specified XML resource.
|
public static Document read(String uri, IResourceContext context) throws ResourceException, ContentException, IOException, SAXException
uri - the URI of the resource to be readcontext - the resource contextIOException - if an I/O error has occuredContentException - if the content is invalidResourceException - on errorSAXException - on parser errorpublic static Document read(IResource resource) throws ResourceException, ContentException, IOException, SAXException
resource - the resource to be readIOException - if an I/O error has occuredContentException - if the content is invalidResourceException - on errorSAXException - on parser errorpublic static void write(String uri, IDOMStorable storable, IResourceContext context) throws ResourceException, IOException
uri - the URI of the resource to be (opver-)written.
If the resource does not exists, it will be createdstorable - the IDOMStorable object to writecontext - the resource contextIOException - if an I/O error has occuredResourceException - on errorpublic static void write(String uri, Document document, IResourceContext context) throws ResourceException, IOException
uri - the URI of the resource to be (over-)written.
If the resource does not exists, it will be created.document - the DOM representation to writecontext - the resource contextIOException - if an I/O error has occuredResourceException - on errorpublic static void write(IResource resource, IDOMStorable storable) throws ResourceException, IOException
resource - the resource to be updatedstorable - the IDOMStorable object to be writtenIOException - if an I/O error has occuredResourceException - on errorpublic static void write(IResource resource, Document document) throws ResourceException, IOException
resource - the resource to be updateddocument - the DOM representation to writeIOException - if an I/O error has occuredResourceException - on errorpublic static byte[] serialize(IDOMStorable storable) throws IOException
IDOMStorable object into a byte array.storable - the IDOMStorable to be serializedIOException - if an I/O error has occuredpublic static byte[] serialize(Document document) throws IOException
document - the DOM representation to be serializedIOException - if an I/O error has occured| 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