Class WebFormPart
java.lang.Object
io.fluxzero.sdk.web.WebFormPart
Represents a single
multipart/form-data part.
Text fields and file uploads are exposed through the same type. Use isFile() to distinguish file parts,
asString() for text content, and getContent() or getInputStream() for raw bytes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasString()Decodes the content using the charset in the Content-Type header, defaulting to UTF-8 when that charset is absent or unsupported.booleanbyte[]Returns a defensive copy of the part's content bytes.Returns the part's content type, if supplied.Returns the uploaded file name, or null for a part without a file name.Returns the first value of a header, or an empty optional if absent.Returns the part's headers grouped by name.getHeaders(String name) Returns all values for a header, or an empty list if absent.Returns a new input stream over the part's content, with an independent read position.getName()Returns the form field name associated with this part.inthashCode()booleanisFile()Returns whether this part carries a file name, including an empty file name.toString()
-
Constructor Details
-
WebFormPart
-
-
Method Details
-
getName
Returns the form field name associated with this part. -
getFileName
Returns the uploaded file name, or null for a part without a file name. -
getContentType
Returns the part's content type, if supplied. -
getHeaders
-
getHeaders
-
getHeader
-
getContent
public byte[] getContent()Returns a defensive copy of the part's content bytes. -
getInputStream
Returns a new input stream over the part's content, with an independent read position. -
isFile
public boolean isFile()Returns whether this part carries a file name, including an empty file name. -
asString
Decodes the content using the charset in the Content-Type header, defaulting to UTF-8 when that charset is absent or unsupported. -
equals
-
hashCode
-
toString
-