public class MimeTypeValidator extends Object implements Validator
A mime type that matches the pattern should return Status.INVALID_CONTENT
,
or Status.VALID
otherwise.
Validator.Status
ALWAYS_VALID
Constructor and Description |
---|
MimeTypeValidator(Pattern regex)
Constructs mime type validator.
|
MimeTypeValidator(String regex)
Constructs mime type validator.
|
Modifier and Type | Method and Description |
---|---|
Validator.Status |
isValid(Request request,
Response response)
Method will be called when a response need validation.
|
public MimeTypeValidator(String regex)
regex
- A regex string to match valid mime typepublic MimeTypeValidator(Pattern regex)
regex
- A regex pattern to match valid mime typepublic final Validator.Status isValid(Request request, Response response)
Validator
Copyright © 2019. All rights reserved.