Class ContentTypes

java.lang.Object
org.zkoss.util.media.ContentTypes

public class ContentTypes extends Object
Utilities relevant to content types.
Author:
tomyeh
  • Constructor Details

    • ContentTypes

      protected ContentTypes()
  • Method Details

    • isBinary

      public static final boolean isBinary(String ctype)
      Returns whether the content type is binary.
      Parameters:
      ctype - the content type, e.g., text/plain If ctype is null or empty, false is returned.
      Since:
      3.0.6
    • getContentType

      public static final String getContentType(String format)
      Returns the content type of the specified format, such as "html" and "pdf", or null if not found (or format is null).
    • getFormat

      public static final String getFormat(String ctype)
      Returns the format of the specified content type, or null if not found.
      Throws:
      IllealArgumentException - if ctype is null
    • put

      public static final void put(String format, String ctype)
      Adds additional binding of the format and content type.

      You rarely need to invoke this method, unless your format is not by the default mapping.