public static class HttpConnection.KeyVal extends Object implements Connection.KeyVal
Modifier and Type | Field and Description |
---|---|
private String |
contentType |
private String |
key |
private InputStream |
stream |
private String |
value |
Modifier | Constructor and Description |
---|---|
private |
KeyVal() |
Modifier and Type | Method and 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
|
private InputStream stream
private String contentType
private 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.KeyVal
key
in interface Connection.KeyVal
key
- new keypublic String key()
Connection.KeyVal
key
in interface Connection.KeyVal
public HttpConnection.KeyVal value(String value)
Connection.KeyVal
value
in interface Connection.KeyVal
value
- the new valuepublic String value()
Connection.KeyVal
value
in interface Connection.KeyVal
public HttpConnection.KeyVal inputStream(InputStream inputStream)
Connection.KeyVal
inputStream
in interface Connection.KeyVal
inputStream
- new input streampublic InputStream inputStream()
Connection.KeyVal
inputStream
in interface Connection.KeyVal
public boolean hasInputStream()
Connection.KeyVal
hasInputStream
in interface Connection.KeyVal
public Connection.KeyVal contentType(String contentType)
Connection.KeyVal
Connection.KeyVal.inputStream(InputStream)
is set.
Will default to application/octet-stream
.
contentType
in interface Connection.KeyVal
contentType
- the new content typepublic String contentType()
Connection.KeyVal
null
if not set.contentType
in interface Connection.KeyVal
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses