public class MediaConstraintsException extends UploadRejectedException
Modifier and Type | Class and Description |
---|---|
static class |
MediaConstraintsException.EXCEPTION_VARIANT
Definition of the exception variant type.
|
Constructor and Description |
---|
MediaConstraintsException(String message)
Create a new exception instance.
|
MediaConstraintsException(String message,
Map<String,String> params)
Create a new exception instance.
|
MediaConstraintsException(String message,
Map<String,String> params,
MediaConstraintsException.EXCEPTION_VARIANT type)
Create a new exception instance.
|
Modifier and Type | Method and Description |
---|---|
MediaConstraintsException.EXCEPTION_VARIANT |
getExceptionType()
Get the variant type used for computing a generic fallback message.
|
static Map<String,String> |
getHumanReadableSize(Map<String,String> params)
Returns human readable values.
|
String |
getMessage() |
Map<String,String> |
getParams()
Return the given parameter map.
|
getStoreElement, setStoreElement
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public MediaConstraintsException(String message)
message
- a meaningful cause why rejecting this uploadpublic MediaConstraintsException(String message, Map<String,String> params)
final Mapparameter = new HashMap (); parameter.put("extension", mimeType.getExtension()); parameter.put("mime_type", mimeType.toString()); parameter.put("allowed_extensions", "jpg,png,gif,bmp"); throw new MediaConstraintsException( "message", parameter );
message
- a meaningful cause why rejecting this uploadparams
- a parameter map - see example.public MediaConstraintsException(String message, Map<String,String> params, MediaConstraintsException.EXCEPTION_VARIANT type)
final Mapparameter = new HashMap (); parameter.put("extension", mimeType.getExtension()); parameter.put("mime_type", mimeType.toString()); parameter.put("allowed_extensions", "jpg,png,gif,bmp"); throw new MediaConstraintsException( "message", parameter, de.espirit.firstspirit.store.access.mediastore.MediaConstraintsException.EXCEPTION_VARIANT.MEDIA_EXTENSION_REJECTED );
message
- a meaningful cause why rejecting this uploadparams
- a parameter map - see example.type
- the exception variant typepublic static Map<String,String> getHumanReadableSize(Map<String,String> params)
final Mapparameter = new HashMap (); parameter.put("extension", mimeType.getExtension()); parameter.put("mime_type", mimeType.toString()); parameter.put("allowed_extensions", "jpg,png,gif,bmp"); throw new MediaConstraintsException( "message", parameter, de.espirit.firstspirit.store.access.mediastore.MediaConstraintsException.EXCEPTION_VARIANT.MEDIA_EXTENSION_REJECTED );
params
- a parameter map - see example.public MediaConstraintsException.EXCEPTION_VARIANT getExceptionType()
public Map<String,String> getParams()
final Mapparameter = new HashMap (); parameter.put("extension", mimeType.getExtension()); parameter.put("mime_type", mimeType.toString()); parameter.put("allowed_extensions", "jpg,png,gif,bmp"); throw new MediaConstraintsException( "message", parameter, de.espirit.firstspirit.store.access.mediastore.MediaConstraintsException.EXCEPTION_VARIANT.MEDIA_EXTENSION_REJECTED );
public String getMessage()
getMessage
in class Throwable
Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210