Class HttpServer.Part
java.lang.Object
com.codename1.backend.HttpServer.Part
- Enclosing class:
HttpServer
One part of a
multipart/form-data request body: a form field, or an
uploaded file when it has a filename.-
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()The part's content.The part's Content-Type, or null when it declared none.The uploaded file's name as the client gave it, or null for a plain field.One of the part's own headers, by a name in any case; or null.getName()The field name from its Content-Disposition, or null.intgetSize()The part's content length in bytes.getText()The part's content as UTF-8 text.
-
Method Details
-
getName
The field name from its Content-Disposition, or null. -
getFilename
The uploaded file's name as the client gave it, or null for a plain field. Never use it as a path: it is whatever the client sent. -
getContentType
The part's Content-Type, or null when it declared none. -
getHeader
-
getSize
public int getSize()The part's content length in bytes. -
getBytes
public byte[] getBytes()The part's content. The array is the part's; copy it to change it. -
getText
The part's content as UTF-8 text. Throws IllegalStateException when it is not valid UTF-8 -- a binary upload -- rather than returning replacement characters the client never sent.
-