Class RestUtil


  • public class RestUtil
    extends Object
    Set of methods to use in the REST Controllers
    Author:
    Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
    • Constructor Detail

      • RestUtil

        public RestUtil()
    • Method Detail

      • getResponseEntity

        public static org.springframework.http.ResponseEntity getResponseEntity​(Exception ex)
        Gets a no content response.
        Parameters:
        ex - Throw exception
        Returns:
        A no content response with header error.
      • isBase64

        public static boolean isBase64​(String string)
        Evaluates if a string is in Base64 format.
        Parameters:
        string - String to be evaluated.
        Returns:
        True if the string is in Base64 format otherwise false.
      • transientScriptedQueryParameterToScriptedQueryParameter

        public static ScriptedQueryParameter transientScriptedQueryParameterToScriptedQueryParameter​(TransientScriptedQueryParameter parameter)
        Helper class to parse from a TransientScriptedQueryParameter into a ScriptedQueryParameter.
        Parameters:
        parameter - Transient ScriptedQuery Parameter.
        Returns:
        ScriptedQueryParameter.
      • transientArtifactToArtifact

        public static Artifact transientArtifactToArtifact​(TransientArtifact artifact)
        Helper class to parse from a TransientArtifact into a Artifact.
        Parameters:
        artifact - Transient Artifact.
        Returns:
        Artifact.