Class MultipartBuilder
-
- All Implemented Interfaces:
-
au.com.dius.pact.consumer.dsl.BodyBuilder
public class MultipartBuilder implements BodyBuilder
Builder class for constructing multipart/\* bodies.
-
-
Field Summary
Fields Modifier and Type Field Description private final MatchingRulesmatchingRules
-
Constructor Summary
Constructors Constructor Description MultipartBuilder()
-
Method Summary
Modifier and Type Method Description final MatchingRulesgetMatchingRules()MatchingRuleCategorygetMatchers()Returns the matchers for the body MatchingRuleCategorygetHeaderMatchers()Returns any matchers that are required for headers GeneratorsgetGenerators()Returns the generators for the body ContentTypegetContentType()Returns the content type for the body ByteArraybuildBody()Constructs the body returning the contents as a byte array final MultipartBuilderfilePart(String partName, String fileName, InputStream inputStream, String contentType)Adds the contents of an input stream as a binary part with the given name and file name final MultipartBuilderfilePart(String partName, String fileName, InputStream inputStream)Adds the contents of an input stream as a binary part with the given name and file name final MultipartBuilderfilePart(String partName, InputStream inputStream)Adds the contents of an input stream as a binary part with the given name and file name final MultipartBuilderbinaryPart(String partName, String fileName, ByteArray bytes, String contentType)Adds the contents of a byte array as a binary part with the given name and file name final MultipartBuilderbinaryPart(String partName, String fileName, ByteArray bytes)Adds the contents of a byte array as a binary part with the given name and file name final MultipartBuilderbinaryPart(String partName, ByteArray bytes)Adds the contents of a byte array as a binary part with the given name and file name final MultipartBuilderjsonPart(String partName, DslPart part)Adds a JSON document as a part, using the standard Pact JSON DSL final MultipartBuildertextPart(String partName, String value, String contentType)Adds the contents of a string as a text part with the given name final MultipartBuildertextPart(String partName, String value)Adds the contents of a string as a text part with the given name -
-
Method Detail
-
getMatchingRules
final MatchingRules getMatchingRules()
-
getMatchers
MatchingRuleCategory getMatchers()
Returns the matchers for the body
-
getHeaderMatchers
MatchingRuleCategory getHeaderMatchers()
Returns any matchers that are required for headers
-
getGenerators
Generators getGenerators()
Returns the generators for the body
-
getContentType
ContentType getContentType()
Returns the content type for the body
-
filePart
@JvmOverloads() final MultipartBuilder filePart(String partName, String fileName, InputStream inputStream, String contentType)
Adds the contents of an input stream as a binary part with the given name and file name
-
filePart
@JvmOverloads() final MultipartBuilder filePart(String partName, String fileName, InputStream inputStream)
Adds the contents of an input stream as a binary part with the given name and file name
-
filePart
@JvmOverloads() final MultipartBuilder filePart(String partName, InputStream inputStream)
Adds the contents of an input stream as a binary part with the given name and file name
-
binaryPart
@JvmOverloads() final MultipartBuilder binaryPart(String partName, String fileName, ByteArray bytes, String contentType)
Adds the contents of a byte array as a binary part with the given name and file name
-
binaryPart
@JvmOverloads() final MultipartBuilder binaryPart(String partName, String fileName, ByteArray bytes)
Adds the contents of a byte array as a binary part with the given name and file name
-
binaryPart
@JvmOverloads() final MultipartBuilder binaryPart(String partName, ByteArray bytes)
Adds the contents of a byte array as a binary part with the given name and file name
-
jsonPart
final MultipartBuilder jsonPart(String partName, DslPart part)
Adds a JSON document as a part, using the standard Pact JSON DSL
-
textPart
@JvmOverloads() final MultipartBuilder textPart(String partName, String value, String contentType)
Adds the contents of a string as a text part with the given name
-
textPart
@JvmOverloads() final MultipartBuilder textPart(String partName, String value)
Adds the contents of a string as a text part with the given name
-
-
-
-