Tabnine Logo
XMLUtil.readerToString
Code IndexAdd Tabnine to your IDE (free)

How to use
readerToString
method
in
org.apache.activemq.artemis.utils.XMLUtil

Best Java code snippets using org.apache.activemq.artemis.utils.XMLUtil.readerToString (Showing top 7 results out of 315)

origin: apache/activemq-artemis

public void parseConfiguration(final InputStream input) throws Exception {
 Reader reader = new InputStreamReader(input);
 String xml = XMLUtil.readerToString(reader);
 xml = XMLUtil.replaceSystemProps(xml);
 Element e = XMLUtil.stringToElement(xml);
 // only parse elements from <jms>
 NodeList children = e.getElementsByTagName(CONFIGURATION_SCHEMA_ROOT_ELEMENT);
 if (children.getLength() > 0) {
   parseConfiguration(children.item(0));
 }
}
origin: apache/activemq-artemis

public Configuration parseMainConfig(final InputStream input) throws Exception {
 Reader reader = new InputStreamReader(input);
 String xml = XMLUtil.readerToString(reader);
 xml = XMLUtil.replaceSystemProps(xml);
 Element e = XMLUtil.stringToElement(xml);
 SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
 Schema schema = schemaFactory.newSchema(XMLUtil.findResource("schema/artemis-server.xsd"));
 Validator validator = schema.newValidator();
 try {
   validator.validate(new DOMSource(e));
 } catch (Exception ex) {
   ActiveMQServerLogger.LOGGER.error(ex.getMessage());
 }
 Configuration config = new ConfigurationImpl();
 parseMainConfig(e, config);
 return config;
}
origin: apache/activemq-artemis

 @Override
 public void reload(URL url) throws Exception {
   ActiveMQServerLogger.LOGGER.reloadingConfiguration("jms");
   InputStream input = url.openStream();
   String xml;
   try (Reader reader = new InputStreamReader(input)) {
    xml = XMLUtil.readerToString(reader);
   }
   xml = XMLUtil.replaceSystemProps(xml);
   Element e = XMLUtil.stringToElement(xml);
   if (config instanceof FileJMSConfiguration) {
    NodeList children = e.getElementsByTagName("jms");
    //if the "jms" element exists then parse it
    if (children.getLength() > 0) {
      ((FileJMSConfiguration) config).parse((Element) children.item(0), url);
      JMSServerManagerImpl.this.deploy();
    }
   }
 }
}
origin: apache/activemq-artemis

public void readConfiguration() throws Exception {
 URL url;
 url = Thread.currentThread().getContextClassLoader().getResource(configurationUrl);
 if (url == null) {
   // trying a different classloader now
   url = getClass().getClassLoader().getResource(configurationUrl);
 }
 if (url == null) {
   // The URL is outside of the classloader. Trying a pure url now
   url = new URL(configurationUrl);
 }
 // create a reader
 try (Reader reader = new InputStreamReader(url.openStream())) {
   String xml = XMLUtil.readerToString(reader);
   //replace any system props
   xml = XMLUtil.replaceSystemProps(xml);
   Element e = XMLUtil.stringToElement(xml);
   //iterate around all the deployables
   for (Deployable deployable : deployables.values()) {
    String root = deployable.getRootElement();
    NodeList children = e.getElementsByTagName(root);
    //if the root element exists then parse it
    if (root != null && children.getLength() > 0) {
      Node item = children.item(0);
      XMLUtil.validate(item, deployable.getSchema());
      deployable.parse((Element) item, url);
    }
   }
 }
}
origin: apache/activemq-artemis

url = configFile.toURI().toURL();
reader = new InputStreamReader(url.openStream());
String xml = XMLUtil.readerToString(reader);
xml = XMLUtil.replaceSystemProps(xml);
Element e = XMLUtil.stringToElement(xml);
origin: org.apache.activemq.rest/artemis-rest

String xml = XMLUtil.readerToString(reader);
xml = XMLUtil.replaceSystemProps(xml);
configuration = (MessageServiceConfiguration) jaxb.createUnmarshaller().unmarshal(new StringReader(xml));
origin: apache/activemq-artemis

String xml = XMLUtil.readerToString(reader);
xml = XMLUtil.replaceSystemProps(xml);
configuration = (MessageServiceConfiguration) jaxb.createUnmarshaller().unmarshal(new StringReader(xml));
org.apache.activemq.artemis.utilsXMLUtilreaderToString

Popular methods of XMLUtil

  • assertEquivalent
  • elementToString
  • findResource
  • getTextContent
    Note: if the content is another element or set of elements, it returns a string representation of th
  • filter
  • readerToElement
  • replaceSystemProps
  • stringToElement
  • validate
  • parseBoolean
  • parseDouble
  • parseInt
  • parseDouble,
  • parseInt,
  • parseLong,
  • stripCDATA

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Reference (javax.naming)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now