public static class HttpConnection.KeyVal extends java.lang.Object implements Connection.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
|
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.KeyVal
key
in interface Connection.KeyVal
key
- new keypublic java.lang.String key()
Connection.KeyVal
key
in interface Connection.KeyVal
public HttpConnection.KeyVal value(java.lang.String value)
Connection.KeyVal
value
in interface Connection.KeyVal
value
- the new valuepublic java.lang.String value()
Connection.KeyVal
value
in interface Connection.KeyVal
public HttpConnection.KeyVal inputStream(java.io.InputStream inputStream)
Connection.KeyVal
inputStream
in interface Connection.KeyVal
inputStream
- new input streampublic java.io.InputStream inputStream()
Connection.KeyVal
inputStream
in interface Connection.KeyVal
public boolean hasInputStream()
Connection.KeyVal
hasInputStream
in interface Connection.KeyVal
public Connection.KeyVal contentType(java.lang.String contentType)
Connection.KeyVal
Connection.KeyVal.inputStream(java.io.InputStream)
is set.
Will default to application/octet-stream
.
contentType
in interface Connection.KeyVal
contentType
- the new content typepublic java.lang.String contentType()
Connection.KeyVal
null
if not set.contentType
in interface Connection.KeyVal
public java.lang.String toString()
toString
in class java.lang.Object