@Contract(threading=STATELESS)
public interface ResourceFactory
Resource
instances for handling cached
HTTP response bodies.Modifier and Type | Method and Description |
---|---|
Resource |
copy(String requestId,
Resource resource)
Deprecated.
Do not use.
|
Resource |
generate(String requestId,
byte[] content)
Creates a
Resource from a given response body. |
Resource |
generate(String requestId,
byte[] content,
int off,
int len)
Creates a
Resource from a given response body. |
default Resource |
generate(String requestId,
String eTag,
byte[] content,
int off,
int len)
Creates a
Resource from a given response body. |
Resource generate(String requestId, byte[] content) throws ResourceIOException
Resource
from a given response body.requestId
- a unique identifier for this particular response body.content
- byte array that represents the origin HTTP response body.Resource
containing however much of
the response body was successfully read.ResourceIOException
Resource generate(String requestId, byte[] content, int off, int len) throws ResourceIOException
Resource
from a given response body.requestId
- a unique identifier for this particular response body.content
- byte array that represents the origin HTTP response body.off
- the start offset in the array.len
- the number of bytes to read from the array.Resource
containing however much of
the response body was successfully read.ResourceIOException
default Resource generate(String requestId, String eTag, byte[] content, int off, int len) throws ResourceIOException
Resource
from a given response body.requestId
- a unique identifier for this particular response body.eTag
- eTag Strong (unique) identifier for the resource entity
with the given requestId, or null
when not given
or is weak (non-unique).content
- byte array that represents the origin HTTP response body.off
- the start offset in the array.len
- the number of bytes to read from the array.Resource
containing however much of
the response body was successfully read.ResourceIOException
@Deprecated Resource copy(String requestId, Resource resource) throws ResourceIOException
ResourceIOException
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.