Class ContentTypeUtils

java.lang.Object
org.activiti.cloud.services.common.util.ContentTypeUtils

public final class ContentTypeUtils extends Object
Utils for handling content type
  • Field Details

  • Method Details

    • getContentTypeByExtension

      public static Optional<String> getContentTypeByExtension(String extension)
      Get the content type corresponding to an extension.
      Parameters:
      extension - the extension to search the content type for
      Returns:
      the content type
    • getContentTypeByPath

      public static Optional<String> getContentTypeByPath(String path)
      Get the content type corresponding to a path.
      Parameters:
      path - the path to search the content type for
      Returns:
      the content type
    • isJsonContentType

      public static boolean isJsonContentType(String contentType)
      Check if a content type is json
      Parameters:
      contentType - the content type to check
      Returns:
      true if the given content type is json
    • isSvgContentType

      public static boolean isSvgContentType(String contentType)
      Check if a content type is svg image
      Parameters:
      contentType - the content type to check
      Returns:
      true if the given content type is svg
    • toJsonFilename

      public static String toJsonFilename(String filename)
    • changeToJsonFilename

      public static String changeToJsonFilename(String filename)
    • setExtension

      public static String setExtension(String filename, String extension)
    • changeExtension

      public static String changeExtension(String filename, String extension)
    • removeExtension

      public static String removeExtension(String filename, String extension)
    • fullExtension

      public static String fullExtension(String extension)