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