Created
August 28, 2017 15:47
-
-
Save daneshk/e8136a95bec50e77c46d6f5bfc772580 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String resourcePath = "/esb/abc.xml"; | |
boolean resourceExists = configRegistry.resourceExists(resourcePath); | |
if (resourceExists) { | |
Resource registryResource = configRegistry.get(resourcePath); | |
try { | |
OMElement contentElement = AXIOMUtil.stringToOM( | |
new String((byte[]) registryResource.getContent())); | |
contentElement.addChild(garElement); //edit content | |
registryResource.setContent(contentElement.toString()); | |
configRegistry.put(resourcePath, registryResource); | |
} catch (XMLStreamException e) { | |
log.warn("Error occurred while retrieving the content of registry resource", e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment