public class MimeTypeValidator extends Object implements Validator
A mime type that matches the pattern should return Status.INVALID_CONTENT,
or Status.VALID otherwise.
Validator.StatusALWAYS_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)
ValidatorCopyright © 2018. All rights reserved.