Class FormPart
java.lang.Object
build.serve.form.FormPart
A single part from a
multipart/form-data request body.- Since:
- Apr-2026
- Author:
- reed.vonredwitz
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()The raw bytes of this part's body.TheContent-Typeof this part, if declared.filename()The client-supplied filename, if this part represents a file upload.name()The form field name from theContent-Dispositionheader.value()The part body decoded as a UTF-8 string.
-
Method Details
-
name
The form field name from theContent-Dispositionheader.- Returns:
- the field name
-
filename
The client-supplied filename, if this part represents a file upload.Any path components the client embedded (e.g.
../../etc/passwd) have already been stripped, so this is always a bare filename — safe to use as the final path segment when saving the upload, but callers should still resolve it against a known directory rather than trusting it as a full path.- Returns:
- the filename, or empty for plain form fields
-
contentType
-
bytes
public byte[] bytes()The raw bytes of this part's body.- Returns:
- the part body as a byte array
-
value
-