Examples of InputSource


Examples of org.xml.sax.InputSource

      }

      try
      {
        final ByteArrayInputStream bin = new ByteArrayInputStream(bo.toByteArray());
        ReportGenerator.getInstance().parseReport(new InputSource(bin), url);
      }
      catch (Exception e)
      {
        logger.debug("Failed to (re)parse " + url, e);
        logger.debug (bo.toString("UTF-16"));
View Full Code Here

Examples of org.xml.sax.InputSource

public class SourceTypeTest extends AbstractXFireAegisTest
{
    public void testSAX() throws Exception
    {
        InputSource is = new InputSource(getResourceAsStream("test.xml"));
        SAXSource s = new SAXSource(is);
       
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(bos);
        writer.writeStartDocument();
View Full Code Here

Examples of org.xml.sax.InputSource

        load(fis);
    }

    public static void load(InputStream is) throws ChaiDBException {
        try {
            InputSource inputSource = new InputSource(is);
            DOMParser parser = new DOMParser();
            parser.parse(inputSource);
            Document document = parser.getDocument();
            if (document == null) {
                throw new ChaiDBException(ErrorCode.PARSE_ERROR, "Config File is not well-formed!");
View Full Code Here

Examples of org.xml.sax.InputSource

            return null;
        }

        Document doc;
        try {
            InputSource input = new InputSource(new FileInputStream(controlFilePath));
            doc = SafeUpdateUtils.parse(input);
        } catch (Exception e) {
            logger.error(e);
            doc = null;
        }
View Full Code Here

Examples of org.xml.sax.InputSource

   * @param nms
   */
  private void testXerces(String nm, String[] nms) {
     SAXParser sax = new SAXParser();
     try {
      InputSource in = new InputSource(new URL(nm).openStream());
      sax.parse(in);
      for (int i=0;i<nms.length;i++) {
        in = new InputSource(new URL(nms[i]).openStream());
        sax.parse(in);
      }
      currentMem();
      sax.equals("");
     
View Full Code Here

Examples of org.xml.sax.InputSource

  public static Document parseInputStream(final InputStream instream)
      throws ParserConfigurationException, SAXException, IOException
  {
    final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    final DocumentBuilder db = dbf.newDocumentBuilder();
    return db.parse(new InputSource(instream));
  }
View Full Code Here

Examples of org.xml.sax.InputSource

            }
        };

        MockHttpServletResponse response = new MockHttpServletResponse();
        exporter.handleRequest(request, response);
        InputSource source = new InputSource(new ByteArrayInputStream(response.getContentAsByteArray()));
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        reader.readWSDL("", source);
    }
View Full Code Here

Examples of org.xml.sax.InputSource

                return "wsdl";
            }
        };
        MockHttpServletResponse response = new MockHttpServletResponse();
        exporter.handleRequest(request, response);
        InputSource source = new InputSource(new ByteArrayInputStream(response.getContentAsByteArray()));
        WSDLFactory factory = WSDLFactory.newInstance();
        WSDLReader reader = factory.newWSDLReader();
        Definition definition = reader.readWSDL("", source);
        Service service = definition.getService(new QName(namespace, name));
        assertNotNull(service);
View Full Code Here

Examples of org.xml.sax.InputSource

        public Element asElement() {
            if (element == null) {
                Document document;
                try {
                    document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(toString())));
                } catch (Exception e) {
                    throw UncheckedException.asUncheckedException(e);
                }
                element = document.getDocumentElement();
                builder = null;
View Full Code Here

Examples of org.xml.sax.InputSource

  static final InputSource createInputSource(Context context, Any source)
      throws SAXException, IOException
  {
    if (source.isString()) {
      return new InputSource(new StringReader(source.toString()));
     
    } else if (source instanceof AnyFile) {
      File file = (File)source.toObject();
      context.checkRead(file.getPath());
      return new InputSource(new FileInputStream(file));
     
    } else if (source instanceof AnyURL) {
      URL url = (URL)source.toObject();
      return new InputSource(url.openStream());
     
    } else if (source instanceof AnyInputStream) {
      InputStream input = (InputStream)source.toObject();
      return new InputSource(input);
     
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.