Class HttpUtils.MultipartForm
java.lang.Object
com.erudika.para.server.utils.HttpUtils.MultipartForm
- Enclosing class:
HttpUtils
A class for handling the form data from form submissions.
- Author:
- Alex Bogdanovski [[email protected]]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpUtils.MultipartFormfromJson(InputStream json) Deserializes a MultipartForm from JSON.getEmail()Returns the email of the sender.org.springframework.web.multipart.MultipartFilegetFile()Returns the uploaded file.Returns the message body.getName()Returns the name of the sender.Returns the message subject.String[]Returns the list of recipient emails.booleanChecks if markdown is enabled.booleanChecks if the message is plaintext only.voidSets the email of the sender.voidsetFile(org.springframework.web.multipart.MultipartFile file) Sets the uploaded file.voidsetMarkdownEnabled(boolean markdownEnabled) Sets the markdown enabled flag.voidsetMessage(String message) Sets the message body.voidSets the name of the sender.voidsetPlaintextOnly(boolean plaintextOnly) Sets the plaintext only flag.voidsetSubject(String subject) Sets the message subject.voidsetToEmails(String[] toEmails) Sets the list of recipient emails.
-
Constructor Details
-
MultipartForm
public MultipartForm()Default constructor.
-
-
Method Details
-
getName
-
setName
-
getEmail
-
setEmail
-
getToEmails
-
setToEmails
Sets the list of recipient emails.- Parameters:
toEmails- a list of emails
-
getMessage
-
setMessage
-
getSubject
-
setSubject
-
isPlaintextOnly
public boolean isPlaintextOnly()Checks if the message is plaintext only.- Returns:
- true if plaintext
-
setPlaintextOnly
public void setPlaintextOnly(boolean plaintextOnly) Sets the plaintext only flag.- Parameters:
plaintextOnly- true if plaintext
-
isMarkdownEnabled
public boolean isMarkdownEnabled()Checks if markdown is enabled.- Returns:
- true if markdown is enabled
-
setMarkdownEnabled
public void setMarkdownEnabled(boolean markdownEnabled) Sets the markdown enabled flag.- Parameters:
markdownEnabled- true if markdown is enabled
-
getFile
public org.springframework.web.multipart.MultipartFile getFile()Returns the uploaded file.- Returns:
- the file
-
setFile
public void setFile(org.springframework.web.multipart.MultipartFile file) Sets the uploaded file.- Parameters:
file- the file
-
fromJson
Deserializes a MultipartForm from JSON.- Parameters:
json- the JSON input stream- Returns:
- a new instance or null
-