@Test @JUnitDNSServer(port=9153, zones={ @DNSZone(name="example.com", entries={ @DNSEntry(hostname="www", address="72.14.204.99") }) }) public void dwoGetInputStream() throws IOException { URLConnection c = new DnsRequisitionUrlConnection(new URL(TEST_URL)); InputStream s = c.getInputStream(); Assert.assertNotNull(s); s.close(); }
@Override public InputStream getInputStream() throws IOException { InputStream stream = null; try { Requisition r = buildRequisitionFromZoneTransfer(); stream = new ByteArrayInputStream(jaxBMarshal(r).getBytes()); } catch (IOException e) { log().warn("getInputStream: Problem getting input stream: "+e, e); throw e; } catch (Throwable e) { String message = "Problem getting input stream: "+e; log().warn(message, e); throw new IOExceptionWithCause(message,e ); } return stream; }
DnsRequisitionUrlConnection extends URLConnection { @Override public InputStream getInputStream() throws IOException { InputStream stream = null; try { Requisition r = buildRequisitionFromZoneTransfer(); stream = new ByteArrayInputStream(jaxBMarshal(r).getBytes()); } catch (IOException e) { log().warn("getInputStream: Problem getting input stream: "+e, e); throw e; } catch (Throwable e) { String message = "Problem getting input stream: "+e; log().warn(message, e); throw new IOExceptionWithCause(message,e ); } return stream; } }
DnsRequisitionUrlConnection extends URLConnection { @Override public InputStream getInputStream() throws IOException { InputStream stream = null; try { Requisition r = buildRequisitionFromZoneTransfer(); stream = new ByteArrayInputStream(jaxBMarshal(r).getBytes()); } catch (IOException e) { log().warn("getInputStream: Problem getting input stream: "+e, e); throw e; } catch (Throwable e) { String message = "Problem getting input stream: "+e; log().warn(message, e); throw new IOExceptionWithCause(message,e ); } return stream; } DnsRequisitionUrlConnection(URL url); }
DnsRequisitionUrlConnection extends URLConnection { @Override public InputStream getInputStream() throws IOException { InputStream stream = null; try { Requisition r = buildRequisitionFromZoneTransfer(); stream = new ByteArrayInputStream(jaxBMarshal(r).getBytes()); } catch (IOException e) { log().warn("getInputStream: Problem getting input stream: "+e, e); throw e; } catch (Throwable e) { String message = "Problem getting input stream: "+e; log().warn(message, e); throw new IOExceptionWithCause(message,e ); } return stream; } DnsRequisitionUrlConnection(URL url); @Override void connect(); @Override InputStream getInputStream(); String getZone(); Long getSerial(); void setSerial(Long serial); Boolean getFallback(); void setFallback(Boolean fallback); TSIG getKey(); void setKey(TSIG key); String getDescription(); String toString(); URL getUrl(); static Map<String, String> getArgs(); void setForeignSource(String foreignSource); String getForeignSource(); }
DnsRequisitionUrlConnection extends URLConnection { @Override public InputStream getInputStream() throws IOException { InputStream stream = null; try { Requisition r = buildRequisitionFromZoneTransfer(); stream = new ByteArrayInputStream(jaxBMarshal(r).getBytes()); } catch (IOException e) { log().warn("getInputStream: Problem getting input stream: "+e, e); throw e; } catch (Throwable e) { String message = "Problem getting input stream: "+e; log().warn(message, e); throw new IOExceptionWithCause(message,e ); } return stream; } DnsRequisitionUrlConnection(URL url); @Override void connect(); @Override InputStream getInputStream(); String getZone(); Long getSerial(); void setSerial(Long serial); Boolean getFallback(); void setFallback(Boolean fallback); TSIG getKey(); void setKey(TSIG key); String getDescription(); String toString(); URL getUrl(); static Map<String, String> getArgs(); void setForeignSource(String foreignSource); String getForeignSource(); static final String URL_SCHEME; static final String PROTOCOL; }