Connection.KeyValpublic static class HttpConnection.KeyVal extends Object implements Connection.KeyVal
| Modifier and Type | Method | Description |
|---|---|---|
String |
contentType() |
Get the current Content Type, or
null if not set. |
Connection.KeyVal |
contentType(String contentType) |
Set the Content Type header used in the MIME body (aka mimetype) when uploading files.
|
static HttpConnection.KeyVal |
create(String key,
String value) |
|
static HttpConnection.KeyVal |
create(String key,
String filename,
InputStream stream) |
|
boolean |
hasInputStream() |
Does this keyval have an input stream?
|
InputStream |
inputStream() |
Get the input stream associated with this keyval, if any
|
HttpConnection.KeyVal |
inputStream(InputStream inputStream) |
Add or update an input stream to this keyVal
|
String |
key() |
Get the key of a keyval
|
HttpConnection.KeyVal |
key(String key) |
Update the key of a keyval
|
String |
toString() |
|
String |
value() |
Get the value of a keyval
|
HttpConnection.KeyVal |
value(String value) |
Update the value of a keyval
|
public static HttpConnection.KeyVal create(String key, String value)
public static HttpConnection.KeyVal create(String key, String filename, InputStream stream)
public HttpConnection.KeyVal key(String key)
Connection.KeyValkey in interface Connection.KeyValkey - new keypublic String key()
Connection.KeyValkey in interface Connection.KeyValpublic HttpConnection.KeyVal value(String value)
Connection.KeyValvalue in interface Connection.KeyValvalue - the new valuepublic String value()
Connection.KeyValvalue in interface Connection.KeyValpublic HttpConnection.KeyVal inputStream(InputStream inputStream)
Connection.KeyValinputStream in interface Connection.KeyValinputStream - new input streampublic InputStream inputStream()
Connection.KeyValinputStream in interface Connection.KeyValpublic boolean hasInputStream()
Connection.KeyValhasInputStream in interface Connection.KeyValpublic Connection.KeyVal contentType(String contentType)
Connection.KeyValConnection.KeyVal.inputStream(InputStream) is set.
Will default to application/octet-stream.
contentType in interface Connection.KeyValcontentType - the new content typepublic String contentType()
Connection.KeyValnull if not set.contentType in interface Connection.KeyValCopyright © 2009–2018 Jonathan Hedley. All rights reserved.