Package com.nimbusds.jose.util
Interface RestrictedResourceRetriever
- All Superinterfaces:
ResourceRetriever
- All Known Implementing Classes:
AbstractRestrictedResourceRetriever
,DefaultResourceRetriever
Retriever of resources specified by URL which permits setting of HTTP
connect and read timeouts, size limit and headers.
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the HTTP connect timeout.Gets the headers to set for the HTTP request.int
Gets the HTTP read timeout.int
Gets the HTTP entity size limit.void
setConnectTimeout
(int connectTimeoutMs) Sets the HTTP connect timeout.void
setHeaders
(Map<String, List<String>> headers) Sets the headers to set for the HTTP request.void
setReadTimeout
(int readTimeoutMs) Sets the HTTP read timeout.void
setSizeLimit
(int sizeLimitBytes) Sets the HTTP entity size limit.Methods inherited from interface com.nimbusds.jose.util.ResourceRetriever
retrieveResource
-
Method Details
-
getConnectTimeout
int getConnectTimeout()Gets the HTTP connect timeout.- Returns:
- The HTTP connect timeout, in milliseconds, zero for infinite.
-
setConnectTimeout
Sets the HTTP connect timeout.- Parameters:
connectTimeoutMs
- The HTTP connect timeout, in milliseconds, zero for infinite. Must not be negative.
-
getReadTimeout
int getReadTimeout()Gets the HTTP read timeout.- Returns:
- The HTTP read timeout, in milliseconds, zero for infinite.
-
setReadTimeout
Sets the HTTP read timeout.- Parameters:
readTimeoutMs
- The HTTP read timeout, in milliseconds, zero for infinite. Must not be negative.
-
getSizeLimit
int getSizeLimit()Gets the HTTP entity size limit.- Returns:
- The HTTP entity size limit, in bytes, zero for infinite.
-
setSizeLimit
Sets the HTTP entity size limit.- Parameters:
sizeLimitBytes
- The HTTP entity size limit, in bytes, zero for infinite. Must not be negative.
-
getHeaders
Map<String,List<String>> getHeaders()Gets the headers to set for the HTTP request.- Returns:
- The HTTP headers as name - values map,
null
if not set.
-
setHeaders
Sets the headers to set for the HTTP request.- Parameters:
headers
- The HTTP headers as name - values map,null
if none.
-