public class WorkspaceConfigurationMerger extends Object
Constructor and Description |
---|
WorkspaceConfigurationMerger() |
Modifier and Type | Method and Description |
---|---|
static void |
merge(InputStream repositoryXml,
InputStream workspaceStubXml,
OutputStream workspaceXml)
Create an on the fly
workspaceXml configuration by merging elements from repositoryXml
into workspaceStubXml :
Every direct child element of the Workspace element of repositoryXml is added as a direct
child element to the Workspace element of workspaceStubXml unless an element of the same
name already exists.
No elements are added if a Workspace element does not exist in either repositoryXml or
workspaceStubXml .
Every empty direct child element from thw Workspace element of workspaceStubXml is removed. |
public static void merge(InputStream repositoryXml, InputStream workspaceStubXml, OutputStream workspaceXml) throws ParserConfigurationException, IOException, SAXException, TransformerException
workspaceXml
configuration by merging elements from repositoryXml
into workspaceStubXml
:
Workspace
element of repositoryXml
is added as a direct
child element to the Workspace
element of workspaceStubXml
unless an element of the same
name already exists.Workspace
element does not exist in either repositoryXml
or
workspaceStubXml
.Workspace
element of workspaceStubXml
is removed. repositoryXml
in
workspaceStubXml
.repositoryXml
- input stream containing a valid repository.xml. It is the responsibility of the caller
to close this stream.workspaceStubXml
- input stream containing a stub workspace.xml. It is the responsibility of the caller
to close this stream.workspaceXml
- output stream receiving the result of the merge operation. It is the responsibility of
the caller to close this stream.ParserConfigurationException
- when failing to acquire an XML parserIOException
- when an IO error occurs during reading from the input streamsSAXException
- if any error occurs when parsing the xml from the input streamsTransformerException
- when an error occurs while during mergingCopyright © 2003–2020 Magnolia International Ltd.. All rights reserved.