Package org.jsoup.helper
Class HttpConnection.KeyVal
java.lang.Object
org.jsoup.helper.HttpConnection.KeyVal
- All Implemented Interfaces:
Connection.KeyVal
- Enclosing class:
- HttpConnection
public static class HttpConnection.KeyVal extends Object implements Connection.KeyVal
-
Method Summary
Modifier and Type Method Description String
contentType()
Get the current Content Type, ornull
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 anyHttpConnection.KeyVal
inputStream(InputStream inputStream)
Add or update an input stream to this keyValString
key()
Get the key of a keyvalHttpConnection.KeyVal
key(String key)
Update the key of a keyvalString
toString()
String
value()
Get the value of a keyvalHttpConnection.KeyVal
value(String value)
Update the value of a keyval
-
Method Details
-
create
-
create
-
key
Description copied from interface:Connection.KeyVal
Update the key of a keyval- Specified by:
key
in interfaceConnection.KeyVal
- Parameters:
key
- new key- Returns:
- this KeyVal, for chaining
-
key
Description copied from interface:Connection.KeyVal
Get the key of a keyval- Specified by:
key
in interfaceConnection.KeyVal
- Returns:
- the key
-
value
Description copied from interface:Connection.KeyVal
Update the value of a keyval- Specified by:
value
in interfaceConnection.KeyVal
- Parameters:
value
- the new value- Returns:
- this KeyVal, for chaining
-
value
Description copied from interface:Connection.KeyVal
Get the value of a keyval- Specified by:
value
in interfaceConnection.KeyVal
- Returns:
- the value
-
inputStream
Description copied from interface:Connection.KeyVal
Add or update an input stream to this keyVal- Specified by:
inputStream
in interfaceConnection.KeyVal
- Parameters:
inputStream
- new input stream- Returns:
- this KeyVal, for chaining
-
inputStream
Description copied from interface:Connection.KeyVal
Get the input stream associated with this keyval, if any- Specified by:
inputStream
in interfaceConnection.KeyVal
- Returns:
- input stream if set, or null
-
hasInputStream
public boolean hasInputStream()Description copied from interface:Connection.KeyVal
Does this keyval have an input stream?- Specified by:
hasInputStream
in interfaceConnection.KeyVal
- Returns:
- true if this keyval does indeed have an input stream
-
contentType
Description copied from interface:Connection.KeyVal
Set the Content Type header used in the MIME body (aka mimetype) when uploading files. Only useful ifConnection.KeyVal.inputStream(InputStream)
is set.Will default to
application/octet-stream
.- Specified by:
contentType
in interfaceConnection.KeyVal
- Parameters:
contentType
- the new content type- Returns:
- this KeyVal
-
contentType
Description copied from interface:Connection.KeyVal
Get the current Content Type, ornull
if not set.- Specified by:
contentType
in interfaceConnection.KeyVal
- Returns:
- the current Content Type.
-
toString
-