@Override public InputStream getResponseStream() throws IOException { return delegate.getResponseStream(); }
/** * Returns the InputStream that contains the response from the server. The contents of this * stream vary according to the type of request that was made, and whether it was successful or * not. * * <p><B>NOTE:</B> Note that clients using this code are responsible for closing the InputStream * when they are finished with it. * * @return the input stream containing the response from the server */ public InputStream getInputStream() { try { return httpResponse.getResponseStream(); } catch (IOException e) { throw new RuntimeException(e); } }
public LoggingHTTPResponse(HTTPResponse delegate, String charsetName) throws IOException { super(delegate); ByteArrayOutputStream output = new ByteArrayOutputStream(); LoggingHTTPClient.copy(delegate.getResponseStream(), output); LOGGER.finest("Response: \n" + output.toString(charsetName)); input = new ByteArrayInputStream(output.toByteArray()); }
public Response(HTTPResponse httpResponse) throws ServiceException, IOException { if (httpResponse.getResponseStream() == null) { throw new NullPointerException( "An inputStream is required for " + getClass().getName()); } if (httpResponse.getContentType() == null) { // should missing content type be fatal? Or could we make an assumption? // in case of exception, we have to dispose the response, as it might // be using a deflate input stream, which holds onto native resources httpResponse.getResponseStream().close(); httpResponse.dispose(); throw new NullPointerException("Content type is required for " + getClass().getName()); } this.httpResponse = httpResponse; /* * Intercept XML ServiceExceptions and throw them */ if (httpResponse.getContentType().toLowerCase().equals("application/vnd.ogc.se_xml")) { try { throw parseException(httpResponse.getResponseStream()); } finally { dispose(); } } }
InputStream inputStream = response.getResponseStream(); try { IOUtils.copy(inputStream, buff);
InputStream inputStream = response.getResponseStream(); try { IOUtils.copy(inputStream, buff);
new PushbackInputStream(response.getResponseStream(), buffSize); byte[] buff = new byte[buffSize]; int readCount = 0;
InputStream inputStream = null; try { inputStream = response.getResponseStream(); object = DocumentFactory.getInstance(inputStream, hints, Level.WARNING); } catch (SAXException e) {
final CoordinateReferenceSystem defaultCrs = featureTypeInfo.getCRS(); InputStream responseStream = httpResponse.getResponseStream(); try { File tmpSchemaFile = File.createTempFile(remoteTypeName.getLocalPart(), ".xsd");
InputStream inputStream = response.getResponseStream(); try { IOUtils.copy(inputStream, buff);
@Override public WFSResponse createResponse(HTTPResponse response) throws IOException { final String contentType = response.getContentType(); if (contentType == null) { Logging.getLogger(WFSRequest.class) .warning( this.getOperation() + " request returned null content type for URL " + getFinalURL()); } WFSResponseFactory responseFactory; try { responseFactory = WFSExtensions.findResponseFactory(this, contentType); } catch (FactoryNotFoundException fnf) { Loggers.MODULE.log(Level.WARNING, fnf.getMessage()); try { if (contentType != null && contentType.startsWith("text")) { byte buff[] = new byte[1024]; response.getResponseStream().read(buff); Loggers.MODULE.info("Failed response snippet: " + new String(buff)); } throw fnf; } catch (Exception ignore) { throw fnf; } } WFSResponse wfsResponse = responseFactory.createResponse(this, response); return wfsResponse; }
InputStream inputStream = null; try { inputStream = response.getResponseStream();
/** * Returns the InputStream that contains the response from the server. * The contents of this stream vary according to the type of request * that was made, and whether it was successful or not. * * <B>NOTE:</B> * Note that clients using this code are responsible for closing the * InputStream when they are finished with it. * * @return the input stream containing the response from the server */ public InputStream getInputStream() { try { return httpResponse.getResponseStream(); } catch (IOException e) { throw new RuntimeException(e); } }
public Response(HTTPResponse httpResponse) throws ServiceException, IOException { if( httpResponse.getResponseStream() == null ){ throw new NullPointerException("An inputStream is required for "+getClass().getName()); } if( httpResponse.getContentType() == null ){ // should missing content type be fatal? Or could we make an assumption? throw new NullPointerException("Content type is required for "+getClass().getName()); } this.httpResponse = httpResponse; /* * Intercept XML ServiceExceptions and throw them */ if (httpResponse.getContentType().toLowerCase().equals("application/vnd.ogc.se_xml")) { try { throw parseException(httpResponse.getResponseStream()); } finally { dispose(); } } }
InputStream inputStream = response.getResponseStream(); try { IOUtils.copy(inputStream, buff);
InputStream inputStream = response.getResponseStream(); try { IOUtils.copy(inputStream, buff);
InputStream inputStream = null; try { inputStream = response.getResponseStream(); object = DocumentFactory.getInstance(inputStream, hints, Level.WARNING); } catch (SAXException e) {
final CoordinateReferenceSystem defaultCrs = featureTypeInfo.getCRS(); InputStream responseStream = httpResponse.getResponseStream(); try { File tmpSchemaFile = File.createTempFile(remoteTypeName.getLocalPart(), ".xsd");
@Override public WFSResponse createResponse(HTTPResponse response) throws IOException { final String contentType = response.getContentType(); if (contentType == null) { Logging.getLogger(WFSRequest.class) .warning( this.getOperation() + " request returned null content type for URL " + getFinalURL()); } WFSResponseFactory responseFactory; try { responseFactory = WFSExtensions.findResponseFactory(this, contentType); } catch (FactoryNotFoundException fnf) { Loggers.MODULE.log(Level.WARNING, fnf.getMessage()); try { if (contentType != null && contentType.startsWith("text")) { byte buff[] = new byte[1024]; response.getResponseStream().read(buff); Loggers.MODULE.info("Failed response snippet: " + new String(buff)); } throw fnf; } catch (Exception ignore) { throw fnf; } } WFSResponse wfsResponse = responseFactory.createResponse(this, response); return wfsResponse; }
InputStream inputStream = null; try { inputStream = response.getResponseStream();