Class StringPart
java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.methods.multipart.Part
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.methods.multipart.PartBase
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.methods.multipart.StringPart
Simple string parameter for a multipart post
- Since:
- 2.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default charset of string parametersstatic final String
Default content encoding of string parameters.static final String
Default transfer encoding of string parametersFields inherited from class edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.methods.multipart.Part
BOUNDARY, BOUNDARY_BYTES, CHARSET, CHARSET_BYTES, CONTENT_DISPOSITION, CONTENT_DISPOSITION_BYTES, CONTENT_TRANSFER_ENCODING, CONTENT_TRANSFER_ENCODING_BYTES, CONTENT_TYPE, CONTENT_TYPE_BYTES, CRLF, CRLF_BYTES, EXTRA, EXTRA_BYTES, QUOTE, QUOTE_BYTES
-
Constructor Summary
ConstructorDescriptionStringPart
(String name, String value) Constructor.StringPart
(String name, String value, String charset) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected long
Return the length of the data.protected void
sendData
(OutputStream out) Writes the data to the given OutputStream.void
setCharSet
(String charSet) Sets the character encoding.Methods inherited from class edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.methods.multipart.PartBase
getCharSet, getContentType, getName, getTransferEncoding, setContentType, setName, setTransferEncoding
Methods inherited from class edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.methods.multipart.Part
getBoundary, getLengthOfParts, getLengthOfParts, getPartBoundary, isRepeatable, length, send, sendContentTypeHeader, sendDispositionHeader, sendEnd, sendEndOfHeader, sendParts, sendParts, sendStart, sendTransferEncodingHeader, toString
-
Field Details
-
DEFAULT_CONTENT_TYPE
Default content encoding of string parameters.- See Also:
-
DEFAULT_CHARSET
Default charset of string parameters- See Also:
-
DEFAULT_TRANSFER_ENCODING
Default transfer encoding of string parameters- See Also:
-
-
Constructor Details
-
StringPart
Constructor.- Parameters:
name
- The name of the partvalue
- the string to postcharset
- the charset to be used to encode the string, ifnull
thedefault
is used
-
StringPart
Constructor.- Parameters:
name
- The name of the partvalue
- the string to post
-
-
Method Details
-
sendData
Writes the data to the given OutputStream.- Specified by:
sendData
in classPart
- Parameters:
out
- the OutputStream to write to- Throws:
IOException
- if there is a write error
-
lengthOfData
Return the length of the data.- Specified by:
lengthOfData
in classPart
- Returns:
- The length of the data.
- Throws:
IOException
- If an IO problem occurs- See Also:
-
setCharSet
Description copied from class:PartBase
Sets the character encoding.- Overrides:
setCharSet
in classPartBase
- Parameters:
charSet
- the character encoding, ornull
to exclude the character encoding header
-