/** * Fetch. * @return Response * @throws IOException If fails */ public Response fetch() throws IOException { return this.origin.send( this.request, this.uri, Request.GET, this.headers, this.body, this.connect, this.read ); } }
@Override // @checkstyle ParameterNumber (8 lines) public Response send( final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read ) throws IOException { return this.real.send( req, home, method, headers, content, connect, read ); }
@Override @Timeable(limit = 1, unit = TimeUnit.MINUTES) public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read) throws IOException { return this.origin.send( req, home, method, headers, content, connect, read ); } }
@Override public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read) throws IOException { final Collection<Map.Entry<String, String>> hdrs = new LinkedList<Map.Entry<String, String>>(); boolean absent = true; for (final Map.Entry<String, String> header : headers) { hdrs.add(header); if (header.getKey().equals(HttpHeaders.USER_AGENT)) { absent = false; } } if (absent) { hdrs.add( new ImmutableHeader( HttpHeaders.USER_AGENT, UserAgentWire.AGENT ) ); } return this.origin.send( req, home, method, hdrs, content, connect, read ); } }
@Override public final Response send( final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read ) throws IOException { final Response rsp; if (method.equals(Request.GET) && !this.requestHasCmcHeader(headers)) { rsp = this.consultCache( req, home, method, headers, content, connect, read ); } else { rsp = this.origin.send( req, home, method, headers, content, connect, read ); } return rsp; }
@Override public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read) throws IOException { synchronized (TrustedWire.class) { final SSLSocketFactory def = HttpsURLConnection.getDefaultSSLSocketFactory(); try { HttpsURLConnection.setDefaultSSLSocketFactory( TrustedWire.context().getSocketFactory() ); return this.origin.send( req, home, method, headers, content, connect, read ); } finally { HttpsURLConnection.setDefaultSSLSocketFactory(def); } } }
return this.origin.send( req, home, method, hdrs, content, connect, read );
/** * Fetch response from server. * @param stream The content to send. * @return The obtained response * @throws IOException If an IO exception occurs. */ private Response fetchResponse(final InputStream stream) throws IOException { final long start = System.currentTimeMillis(); final Response response = this.wire.send( this, this.home, this.mtd, this.hdrs, stream, this.connect, this.read ); final URI uri = URI.create(this.home); Logger.info( this, "#fetch(%s %s%s %s): [%d %s] in %[ms]s", this.mtd, uri.getHost(), // @checkstyle AvoidInlineConditionalsCheck (1 line) uri.getPort() > 0 ? String.format(":%d", uri.getPort()) : "", uri.getPath(), response.status(), response.reason(), System.currentTimeMillis() - start ); return response; }
@Override public Response send(final Request req, final String home, final String method, final Collection<Map.Entry<String, String>> headers, final InputStream content, final int connect, final int read) throws IOException { final URI uri = req.uri().get(); final StringBuilder label = new StringBuilder(Tv.HUNDRED) .append(method).append(' ').append(uri.getPath()); if (uri.getQuery() != null) { label.append('?').append(uri.getQuery()); } if (label.toString().matches(this.regex)) { this.cache.invalidate(); } final Response rsp; if (method.equals(Request.GET)) { rsp = this.cache.get( label.toString(), this.origin, req, home, method, headers, content, connect, read ); } else { rsp = this.origin.send( req, home, method, headers, content, connect, read ); } return rsp; }
rsp = this.origin.send( req, home, method, headers, content, connect, read
final Response response = this.origin.send( req, home, method, headers, new ByteArrayInputStream(output.toByteArray()),
) throws IOException { final Response resp = this.origin .send(req, home, method, headers, content, connect, read); final int remaining = this.remainingHeader(resp); if (remaining < this.threshold) {
return this.origin.send( req, home, method, hdrs, content, connect, read );
); } else { rsp = this.origin.send( req, home, method, headers, content, connect, read );
final Response rsp = this.origin.send( req, home, method, headers, content, connect, read
} else { rsp = this.saved( wire.send( request, home, method, headers, input, connect, read
headers, cached ); Response result = this.origin.send( req, home, method, hdrs, content, connect, read );