Package org.forgerock.audit.util
Class ResourceExceptionsUtil
- java.lang.Object
-
- org.forgerock.audit.util.ResourceExceptionsUtil
-
public final class ResourceExceptionsUtil extends Object
Utility class to use on ResourceExceptions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResourceExceptionadapt(Throwable t)Adapts aThrowableto aResourceException.static ResourceExceptionnotSupported(Request request)Creates a NotSupportedException.static ResourceExceptionnotSupportedOnCollection(Request request)Creates a NotSupportedException.static ResourceExceptionnotSupportedOnInstance(Request request)Creates a NotSupportedException.
-
-
-
Method Detail
-
adapt
public static ResourceException adapt(Throwable t)
Adapts aThrowableto aResourceException. If theThrowableis an JSONJsonValueExceptionthen an appropriateResourceExceptionis returned, otherwise anInternalServerErrorExceptionis returned.- Parameters:
t- TheThrowableto be converted.- Returns:
- The equivalent resource exception.
-
notSupported
public static ResourceException notSupported(Request request)
Creates a NotSupportedException.- Parameters:
request- the crest request- Returns:
- a NotSupportedException
-
notSupportedOnCollection
public static ResourceException notSupportedOnCollection(Request request)
Creates a NotSupportedException.- Parameters:
request- the crest request- Returns:
- a NotSupportedException
-
notSupportedOnInstance
public static ResourceException notSupportedOnInstance(Request request)
Creates a NotSupportedException.- Parameters:
request- the crest request- Returns:
- a NotSupportedException
-
-