Package org.jsoup.helper
Class HttpConnection.KeyVal
java.lang.Object
org.jsoup.helper.HttpConnection.KeyVal
- All Implemented Interfaces:
-
Connection.KeyVal
- Enclosing class:
-
HttpConnection
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringGet the current Content Type, ornullif not set.contentType(String contentType) Set the Content Type header used in the MIME body (aka mimetype) when uploading files.static HttpConnection.KeyValcreate(String key, String value) static HttpConnection.KeyValcreate(String key, String filename, InputStream stream) booleanDoes this keyval have an input stream?@Nullable InputStreamGet the input stream associated with this keyval, if anyinputStream(InputStream inputStream) Add or update an input stream to this keyValStringkey()Get the key of a keyvalkey(String key) Update the key of a keyvalStringtoString()Stringvalue()Get the value of a keyvalvalue(String value) Update the value of a keyvalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Method Details
-
create
-
create
-
key
Description copied from interface:Connection.KeyValUpdate the key of a keyval- Specified by:
-
keyin interfaceConnection.KeyVal - Parameters:
-
key- new key - Returns:
- this KeyVal, for chaining
-
key
public String key()Description copied from interface:Connection.KeyValGet the key of a keyval- Specified by:
-
keyin interfaceConnection.KeyVal - Returns:
- the key
-
value
Description copied from interface:Connection.KeyValUpdate the value of a keyval- Specified by:
-
valuein interfaceConnection.KeyVal - Parameters:
-
value- the new value - Returns:
- this KeyVal, for chaining
-
value
public String value()Description copied from interface:Connection.KeyValGet the value of a keyval- Specified by:
-
valuein interfaceConnection.KeyVal - Returns:
- the value
-
inputStream
Description copied from interface:Connection.KeyValAdd or update an input stream to this keyVal- Specified by:
-
inputStreamin interfaceConnection.KeyVal - Parameters:
-
inputStream- new input stream - Returns:
- this KeyVal, for chaining
-
inputStream
Description copied from interface:Connection.KeyValGet the input stream associated with this keyval, if any- Specified by:
-
inputStreamin interfaceConnection.KeyVal - Returns:
- input stream if set, or null
-
hasInputStream
public boolean hasInputStream()Description copied from interface:Connection.KeyValDoes this keyval have an input stream?- Specified by:
-
hasInputStreamin interfaceConnection.KeyVal - Returns:
- true if this keyval does indeed have an input stream
-
contentType
Description copied from interface:Connection.KeyValSet the Content Type header used in the MIME body (aka mimetype) when uploading files. Only useful ifConnection.KeyVal.inputStream(is set.InputStream) Will default to
application/octet-stream.- Specified by:
-
contentTypein interfaceConnection.KeyVal - Parameters:
-
contentType- the new content type - Returns:
- this KeyVal
-
contentType
public @Nullable String contentType()Description copied from interface:Connection.KeyValGet the current Content Type, ornullif not set.- Specified by:
-
contentTypein interfaceConnection.KeyVal - Returns:
- the current Content Type.
-
toString
public String toString()- Overrides:
-
toStringin classObject
-