protected final class UrlHttpClient.CurlBuilder
extends java.lang.Object
| Constructor and Description |
|---|
CurlBuilder(java.net.URL url)
Builds a new curl command for the given
URL. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
build()
Creates a curl command that can be replayed from command line.
|
boolean |
isValid() |
UrlHttpClient.CurlBuilder |
setContent(java.lang.String content)
Set the content used for the given curl command.
|
UrlHttpClient.CurlBuilder |
setContentOverflow(boolean contentOverflow)
Sets whether or not the content is too large for the curl command.
|
UrlHttpClient.CurlBuilder |
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Set the headers used for the given curl command.
|
UrlHttpClient.CurlBuilder |
setMethod(java.lang.String method)
Set the method to call for the given curl command.
|
public CurlBuilder(java.net.URL url)
URL.url - The URL for the operation, must not be
null.public UrlHttpClient.CurlBuilder setMethod(java.lang.String method)
method - The method to use for the request.public UrlHttpClient.CurlBuilder setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers - The headers to use for the request.public UrlHttpClient.CurlBuilder setContent(java.lang.String content)
content - The content to use for the request.public UrlHttpClient.CurlBuilder setContentOverflow(boolean contentOverflow)
Integer.MAX_VALUE are
considered too long. If set, the curl should not be logged as it will
be invalid.contentOverflow - Whether or not the content is too long to
print.public boolean isValid()
public java.lang.String build()
java.lang.IllegalStateException - If isValid() returns false.