Class MultipartArgumentHelper.Builder
java.lang.Object
ru.vyarus.dropwizard.guice.test.client.builder.call.MultipartArgumentHelper.Builder
- Enclosing class:
- MultipartArgumentHelper
Multipart object builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.glassfish.jersey.media.multipart.FormDataMultiPartbuild()Add a simple data part.Add a file part with optionally multiple files (when multiple files applied with the same field name).Add a file part with optionally multiple files (when multiple files applied with the same field name) applied from local file paths (relative to work dir).stream(String field, InputStream stream) Add stream part.stream(String field, InputStream stream, @Nullable String filename) Add stream part with filename.Add a stream part with optionally multiple streams (when multiple files applied with the same field name) from classpath paths.
-
Constructor Details
-
Builder
Create multipart builder.- Parameters:
helper- helper object
-
-
Method Details
-
field
Add a simple data part.- Parameters:
field- field namevalue- field value- Returns:
- builder instance for chained calls
-
file
Add a file part with optionally multiple files (when multiple files applied with the same field name).- Parameters:
field- field namefiles- one or more files- Returns:
- builder instance for chained calls
-
file
Add a file part with optionally multiple files (when multiple files applied with the same field name) applied from local file paths (relative to work dir).- Parameters:
field- filed namepaths- local file paths (relative to work dir)- Returns:
- builder instance for chained calls
- Throws:
IllegalStateException- if file does not exist or is directory
-
stream
Add a stream part with optionally multiple streams (when multiple files applied with the same field name) from classpath paths.- Parameters:
field- field namepaths- classpath paths- Returns:
- builder instance for chained calls
- Throws:
IllegalStateException- if classpath resource not found
-
stream
Add stream part.Important: file name would not be provided.
- Parameters:
field- field namestream- stream instance- Returns:
- builder instance for chained calls
-
stream
public MultipartArgumentHelper.Builder stream(String field, InputStream stream, @Nullable String filename) Add stream part with filename.- Parameters:
field- field namestream- stream instancefilename- filename- Returns:
- builder instance for chained calls
-
build
public org.glassfish.jersey.media.multipart.FormDataMultiPart build()- Returns:
- multipart object
-