core/src/main/java/net/typedrest/AbstractETagEndpoint.java
protected HttpEntity getContent()
            throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException {
        Request request = Request.Get(uri);
        if (last != null) {
            request = request.addHeader(IF_NONE_MATCH, last.etag);
        }

        HttpResponse response = execute(request);
        if (response.getStatusLine().getStatusCode() == SC_NOT_MODIFIED && last != null) {
            return last.content;
        }

        handleResponse(response, request);
        Header etagHeader = response.getFirstHeader(HttpHeaders.ETAG);
        last = (etagHeader == null)
                ? null
                : new Memory(etagHeader.getValue(), response.getEntity());
        return response.getEntity();
    }
protected HttpEntity getContent()
            throws IOException, IllegalArgumentException, IllegalAccessException, FileNotFoundException, IllegalStateException {
        Request request = Request.Get(uri);
        if (last != null) {
            request = request.addHeader(IF_NONE_MATCH, last.etag);
        }

        HttpResponse response = execute(request);
        if (response.getStatusLine().getStatusCode() == SC_NOT_MODIFIED && last != null) {
            return last.content;
        }

        handleResponse(response, request);
        Header etagHeader = response.getFirstHeader(HttpHeaders.ETAG);
        last = (etagHeader == null)
                ? null
                : new Memory(etagHeader.getValue(), response.getEntity());
        return response.getEntity();
    }
protected HttpEntity getContent ( ) throws IOException , IllegalArgumentException , IllegalAccessException , FileNotFoundException , IllegalStateException { Request request = Request . Get ( uri ) ; if ( last != null ) { request = request . addHeader ( IF_NONE_MATCH , last . etag ) ; } HttpResponse response = execute ( request ) ; if ( response . getStatusLine ( ) . getStatusCode ( ) == SC_NOT_MODIFIED && last != null ) { return last . content ; } handleResponse ( response , request ) ; Header etagHeader = response . getFirstHeader ( HttpHeaders . ETAG ) ; last = ( etagHeader == null ) ? null : new Memory ( etagHeader . getValue ( ) , response . getEntity ( ) ) ; return response . getEntity ( ) ; }
Performs an HTTP GET request on the {@link Endpoint#getUri()} and caches
the response if the server sends an ETag header.

Sends {@link HttpHeaders#IF_NONE_MATCH} if there is already a cached
ETag.

@return The response of the request or the cached response if the server
responded with {@link HttpStatus#SC_NOT_MODIFIED}.

@throws IOException Network communication failed.
@throws IllegalArgumentException {@link HttpStatus#SC_BAD_REQUEST}
@throws IllegalAccessException {@link HttpStatus#SC_UNAUTHORIZED} or
{@link HttpStatus#SC_FORBIDDEN}
@throws FileNotFoundException {@link HttpStatus#SC_NOT_FOUND} or
{@link HttpStatus#SC_GONE}
@throws IllegalStateException {@link HttpStatus#SC_CONFLICT}
@throws RuntimeException Other non-success status code.
Performs an HTTP GET request on the { @link Endpoint#getUri () } and caches the response if the server sends an ETag header .