Interface MultipartDataFactory<T>
- Type Parameters:
T- The file upload type
public interface MultipartDataFactory<T>
A factory for Multipart data.
- Since:
- 2.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptioncreateAttribute(@NonNull String name, @NonNull String value) Creates an attribute.createFileUpload(@NonNull String name, @NonNull String filename, @NonNull MediaType contentType, @Nullable String encoding, @Nullable Charset charset, long length) Creates a file upload.voidsetContent(T fileUploadObject, Object content) Sets the content on the file upload object.
-
Method Details
-
createFileUpload
@NonNull T createFileUpload(@NonNull @NonNull String name, @NonNull @NonNull String filename, @NonNull @NonNull MediaType contentType, @Nullable @Nullable String encoding, @Nullable @Nullable Charset charset, long length) Creates a file upload.- Parameters:
name- The name of the filefilename- The file namecontentType- The content typeencoding- The encodingcharset- The charsetlength- The length- Returns:
- The file upload
-
createAttribute
Creates an attribute.- Parameters:
name- The name of the attributevalue- The value of the attribute- Returns:
- The attribute
-
setContent
Sets the content on the file upload object.- Parameters:
fileUploadObject- The file upload objectcontent- The content- Throws:
IOException- When the content cannot be set
-