Class MultipartParser
java.lang.Object
com.pixelservices.flash.components.MultipartParser
MultipartParser parses HTTP multipart/form-data payloads into fields and files.
Note: This is a simplified implementation and may not handle all edge cases or binary data correctly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a file included in a multipart request. -
Constructor Summary
ConstructorsConstructorDescriptionMultipartParser
(String contentType, String body) Constructs a MultipartParser to parse the given content type and body. -
Method Summary
-
Constructor Details
-
MultipartParser
Constructs a MultipartParser to parse the given content type and body.- Parameters:
contentType
- the Content-Type header, expected to be "multipart/form-data".body
- the raw HTTP body to parse.- Throws:
IllegalArgumentException
- if the Content-Type is invalid or boundary is missing.
-
-
Method Details
-
getFile
Retrieves a file by field name.- Parameters:
fieldName
- the name of the field.- Returns:
- the MultipartFile associated with the field, or null if not found.
-
getField
Retrieves a field value by name.- Parameters:
fieldName
- the name of the field.- Returns:
- the field value, or null if not found.
-