Class XMLUtils

java.lang.Object
org.wso2.carbon.webapp.mgt.utils.XMLUtils

public class XMLUtils extends Object
Contains XML utility methods based on DOM.
  • Constructor Details

    • XMLUtils

      public XMLUtils()
  • Method Details

    • buildDocumentFromFile

      public static Document buildDocumentFromFile(File xmlFile) throws Exception
      Build a Document from a file
      Parameters:
      xmlFile - file
      Returns:
      a Document object
      Throws:
      Exception - if an error occurs
    • buildDocumentFromInputStream

      public static Document buildDocumentFromInputStream(InputStream is) throws Exception
      Build a document from a InputStream.
      Parameters:
      is - InputStream
      Returns:
      a Document object
      Throws:
      Exception - if an error occurs
    • getSecuredDocumentBuilder

      public static DocumentBuilderFactory getSecuredDocumentBuilder()
      Returns a secured DocumentBuilderFactory instance
      Returns:
      DocumentBuilderFactory