@Test public void shouldParseFileFromURL() throws Exception { allIsWellFor(Input.fromURL(new URL("file:" + TestResources.ANIMAL_FILE)) .build()); }
public static Builder fromURL(URL url) { try { try (InputStream in = url.openStream()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int read = -1; byte[] buf = new byte[4096]; while ((read = in.read(buf)) >= 0) { if (read > 0) { baos.write(buf, 0, read); } } StreamBuilder b = (StreamBuilder) fromByteArray(baos.toByteArray()); try { b.setSystemId(url.toURI().toString()); } catch (URISyntaxException use) { b.setSystemId(url.toString()); } return b; } } catch (IOException ex) { throw new XMLUnitException(ex); } }
Input { public static Builder fromURL(URL url) { try { try (InputStream in = url.openStream()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int read = -1; byte[] buf = new byte[4096]; while ((read = in.read(buf)) >= 0) { if (read > 0) { baos.write(buf, 0, read); } } StreamBuilder b = (StreamBuilder) fromByteArray(baos.toByteArray()); try { b.setSystemId(url.toURI().toString()); } catch (URISyntaxException use) { b.setSystemId(url.toString()); } return b; } } catch (IOException ex) { throw new XMLUnitException(ex); } } }
Input { public static Builder fromURL(URL url) { try { try (InputStream in = url.openStream()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int read = -1; byte[] buf = new byte[4096]; while ((read = in.read(buf)) >= 0) { if (read > 0) { baos.write(buf, 0, read); } } StreamBuilder b = (StreamBuilder) fromByteArray(baos.toByteArray()); try { b.setSystemId(url.toURI().toString()); } catch (URISyntaxException use) { b.setSystemId(url.toString()); } return b; } } catch (IOException ex) { throw new XMLUnitException(ex); } } private  Input(); }
Input { public static Builder fromURL(URL url) { try { try (InputStream in = url.openStream()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int read = -1; byte[] buf = new byte[4096]; while ((read = in.read(buf)) >= 0) { if (read > 0) { baos.write(buf, 0, read); } } StreamBuilder b = (StreamBuilder) fromByteArray(baos.toByteArray()); try { b.setSystemId(url.toURI().toString()); } catch (URISyntaxException use) { b.setSystemId(url.toString()); } return b; } } catch (IOException ex) { throw new XMLUnitException(ex); } } private  Input(); static Builder fromDocument(Document d); static Builder fromNode(Node n); static Builder from(Object object); static JaxbBuilder fromJaxb(Object jaxbObject); static Builder fromFile(File f); static Builder fromFile(String name); static Builder fromStream(InputStream s); static Builder fromReader(Reader r); static Builder fromString(String s); static Builder fromByteArray(byte[] b); static Builder fromChannel(ReadableByteChannel c); static Builder fromURL(URL url); static Builder fromURI(URI uri); static Builder fromURI(String uri); static TransformationBuilder byTransforming(Source s); static TransformationBuilder byTransforming(Builder b); }
Input { public static Builder fromURL(URL url) { try { try (InputStream in = url.openStream()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int read = -1; byte[] buf = new byte[4096]; while ((read = in.read(buf)) >= 0) { if (read > 0) { baos.write(buf, 0, read); } } StreamBuilder b = (StreamBuilder) fromByteArray(baos.toByteArray()); try { b.setSystemId(url.toURI().toString()); } catch (URISyntaxException use) { b.setSystemId(url.toString()); } return b; } } catch (IOException ex) { throw new XMLUnitException(ex); } } private  Input(); static Builder fromDocument(Document d); static Builder fromNode(Node n); static Builder from(Object object); static JaxbBuilder fromJaxb(Object jaxbObject); static Builder fromFile(File f); static Builder fromFile(String name); static Builder fromStream(InputStream s); static Builder fromReader(Reader r); static Builder fromString(String s); static Builder fromByteArray(byte[] b); static Builder fromChannel(ReadableByteChannel c); static Builder fromURL(URL url); static Builder fromURI(URI uri); static Builder fromURI(String uri); static TransformationBuilder byTransforming(Source s); static TransformationBuilder byTransforming(Builder b);  }