public static class ScrapingRequest.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder()
Creates the builder
|
Modifier and Type | Method and Description |
---|---|
ScrapingRequest.Builder |
addGetParameter(java.lang.String key,
java.lang.String value)
Sets the value
|
ScrapingRequest.Builder |
addHeader(java.lang.String name,
java.lang.String value)
Sets the value
|
ScrapingRequest.Builder |
addHint(ScrapingHint hint)
Sets the value
|
ScrapingRequest.Builder |
addInferredHeader(java.lang.String name,
java.lang.String value)
Sets the value.
|
ScrapingRequest.Builder |
addPostParameter(java.lang.String key,
java.io.File value)
Sets the value
|
ScrapingRequest.Builder |
addPostParameter(java.lang.String key,
java.lang.String value)
Sets the value
|
ScrapingRequest |
build()
Builds and returns the request object
|
java.lang.String |
getBasicAuthenticationPassword()
Returns the BasicAuthenticationPassword for the object
|
java.lang.String |
getBasicAuthenticationUsername()
Returns the BasicAuthenticationUsername for the object
|
java.lang.String |
getBasicNtlmAuthenticationDomain()
Returns the BasicNtlmAuthenticationDomain for the object
|
java.lang.String |
getBasicNtlmAuthenticationHost()
Returns the BasicNtlmAuthenticationHost for the object
|
java.lang.String |
getCharacterEncoding()
Returns the CharacterEncoding for the object
|
java.lang.String |
getEntity()
Returns the Entity for the object
|
java.util.List<RequestParameter> |
getGetParameters()
Returns the GetParameters for the object
|
java.util.Set<ScrapingHttpHeader> |
getHeaders()
Returns the Headers for the object
|
java.util.Set<ScrapingHttpHeader> |
getInferredHeaders()
Returns the InferredHeaders for the object
|
java.lang.String |
getLoggableName()
Returns the LoggableName for the object
|
int |
getMaxResponseLength()
Returns the MaxResponseLength for the object
|
java.util.List<RequestParameter> |
getPostParameters()
Returns the PostParameters for the object
|
java.util.Set<ScrapingHint> |
getRequestHints()
Returns the RequestHints for the object
|
java.io.OutputStream |
getResponseBodyOutputStream()
The response body output stream for the object.
|
ScrapingRequest.Type |
getType()
Returns the Type for the object
|
java.lang.String |
getUrl()
Returns the Url for the object
|
boolean |
isMultipart()
Returns the Multipart for the object
|
ScrapingRequest.Builder |
setBasicAuthenticationPassword(java.lang.String basicAuthenticationPassword)
Sets the value
|
ScrapingRequest.Builder |
setBasicAuthenticationUsername(java.lang.String basicAuthenticationUsername)
Sets the value
|
ScrapingRequest.Builder |
setCharacterEncoding(java.lang.String characterEncoding)
Sets the value
|
ScrapingRequest.Builder |
setEntity(java.lang.String entity)
Sets the entity
|
ScrapingRequest.Builder |
setLoggableName(java.lang.String loggableName)
Sets the name used to represent this request when logging
|
ScrapingRequest.Builder |
setMaxResponseLength(int maxResponseLength)
Sets the max length for the response
|
ScrapingRequest.Builder |
setMultipart(boolean multipart)
Sets the value
|
ScrapingRequest.Builder |
setNtlmAuthenticationDomain(java.lang.String basicNtlmAuthenticationDomain)
Sets the value
|
ScrapingRequest.Builder |
setNtlmAuthenticationHost(java.lang.String basicNtlmAuthenticationHost)
Sets the value
|
ScrapingRequest.Builder |
setResponseBodyOutputStream(java.io.OutputStream out)
Sets the response body output stream for the object.
|
ScrapingRequest.Builder |
setType(ScrapingRequest.Type type)
Sets the request type
|
ScrapingRequest.Builder |
setUrl(java.lang.String url)
Sets the url
|
public ScrapingRequest.Builder setLoggableName(@Nullable java.lang.String loggableName)
loggableName
- The name for loggingpublic ScrapingRequest.Builder setUrl(@Nullable java.lang.String url)
url
- The urlpublic ScrapingRequest.Builder setEntity(@Nullable java.lang.String entity)
entity
- The entitypublic ScrapingRequest.Builder setType(@NotNull ScrapingRequest.Type type)
type
- The request typepublic ScrapingRequest.Builder setMaxResponseLength(int maxResponseLength)
maxResponseLength
- The max length for the responsepublic ScrapingRequest.Builder setBasicAuthenticationUsername(@Nullable java.lang.String basicAuthenticationUsername)
basicAuthenticationUsername
- The valuepublic ScrapingRequest.Builder setBasicAuthenticationPassword(@Nullable java.lang.String basicAuthenticationPassword)
basicAuthenticationPassword
- The valuepublic ScrapingRequest.Builder setNtlmAuthenticationDomain(@Nullable java.lang.String basicNtlmAuthenticationDomain)
basicNtlmAuthenticationDomain
- The valuepublic ScrapingRequest.Builder setNtlmAuthenticationHost(@Nullable java.lang.String basicNtlmAuthenticationHost)
basicNtlmAuthenticationHost
- The valuepublic ScrapingRequest.Builder setCharacterEncoding(@NotNull java.lang.String characterEncoding)
characterEncoding
- The valuepublic ScrapingRequest.Builder addGetParameter(@NotNull java.lang.String key, @NotNull java.lang.String value)
key
- The keyvalue
- The valuepublic ScrapingRequest.Builder addPostParameter(@NotNull java.lang.String key, @NotNull java.lang.String value)
key
- The keyvalue
- The valuepublic ScrapingRequest.Builder addPostParameter(@NotNull java.lang.String key, @NotNull java.io.File value)
key
- The keyvalue
- The valuepublic ScrapingRequest.Builder addHint(@NotNull ScrapingHint hint)
hint
- The valuepublic ScrapingRequest.Builder setMultipart(boolean multipart)
multipart
- The valuepublic ScrapingRequest.Builder addInferredHeader(@NotNull java.lang.String name, @NotNull java.lang.String value)
name
- The namevalue
- The valuepublic ScrapingRequest.Builder addHeader(@NotNull java.lang.String name, @NotNull java.lang.String value)
name
- The namevalue
- The valuepublic ScrapingRequest build()
@Nullable public java.lang.String getBasicAuthenticationUsername()
@Nullable public java.lang.String getBasicAuthenticationPassword()
@NotNull public java.lang.String getCharacterEncoding()
public boolean isMultipart()
@Nullable public java.lang.String getUrl()
@NotNull public java.util.List<RequestParameter> getGetParameters()
@NotNull public java.util.List<RequestParameter> getPostParameters()
@Nullable public java.lang.String getEntity()
@NotNull public java.util.Set<ScrapingHttpHeader> getHeaders()
@NotNull public ScrapingRequest.Type getType()
@Nullable public java.lang.String getLoggableName()
public ScrapingRequest.Builder setResponseBodyOutputStream(@Nullable java.io.OutputStream out)
out
- The new output stream for the response body (excluding headers)@Nullable public java.io.OutputStream getResponseBodyOutputStream()
@NotNull public java.util.Set<ScrapingHttpHeader> getInferredHeaders()
@NotNull public java.util.Set<ScrapingHint> getRequestHints()
@Nullable public java.lang.String getBasicNtlmAuthenticationDomain()
@Nullable public java.lang.String getBasicNtlmAuthenticationHost()
public int getMaxResponseLength()