Class MediaConstraintsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
de.espirit.firstspirit.access.store.mediastore.UploadRejectedException
de.espirit.firstspirit.store.access.mediastore.MediaConstraintsException
- All Implemented Interfaces:
Serializable
This Exception will be thrown if a media constraint setting is violated.
- Since:
- 4.1
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Definition of the exception variant type. -
Constructor Summary
ConstructorDescriptionMediaConstraintsException
(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. -
Method Summary
Modifier and TypeMethodDescriptionGet the variant type used for computing a generic fallback message.getHumanReadableSize
(Map<String, String> params) Returns human readable values.Return the given parameter map.Methods inherited from class de.espirit.firstspirit.access.store.mediastore.UploadRejectedException
getStoreElement, setStoreElement
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MediaConstraintsException
Create a new exception instance. This exception indicates a media constraint setting has been violated.- Parameters:
message
- a meaningful cause why rejecting this upload- Since:
- 4.1
-
MediaConstraintsException
Create a new exception instance. This exception indicates a media constraint setting has been violated.final Map<String, String> parameter = new HashMap<String, String>(); parameter.put("extension", mimeType.getExtension()); parameter.put("mime_type", mimeType.toString()); parameter.put("allowed_extensions", "jpg,png,gif,bmp"); throw new MediaConstraintsException( "message", parameter );
- Parameters:
message
- a meaningful cause why rejecting this uploadparams
- a parameter map - see example.- Since:
- 4.1
-
MediaConstraintsException
public MediaConstraintsException(String message, Map<String, String> params, MediaConstraintsException.EXCEPTION_VARIANT type) Create a new exception instance. This exception indicates a media constraint setting has been violated.final Map<String, String> parameter = new HashMap<String, String>(); 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 );
- Parameters:
message
- a meaningful cause why rejecting this uploadparams
- a parameter map - see example.type
- the exception variant type- Since:
- 4.1
-
-
Method Details
-
getHumanReadableSize
Returns human readable values.
final Map<String, String> parameter = new HashMap<String, String>(); 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 );
- Parameters:
params
- a parameter map - see example.- Returns:
- the evaluated param map
- Since:
- 4.1
-
getExceptionType
Get the variant type used for computing a generic fallback message.- Returns:
- the exception variant type
- Since:
- 4.1
-
getParams
Return the given parameter map.
final Map<String, String> parameter = new HashMap<String, String>(); 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 );
- Returns:
- the parameter map
- Since:
- 4.1
-
getMessage
- Overrides:
getMessage
in classThrowable
-