Enum ContentType

    • Method Detail

      • values

        public static ContentType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ContentType c : ContentType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ContentType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getByExtension

        public static ContentType getByExtension​(String extension)
        Returns a content type by extension, or null if none found
      • getByFileName

        public static ContentType getByFileName​(String fileName)
        Returns a content type by file name, or null if none found
      • getByMimeType

        public static ContentType getByMimeType​(String mimeType)
        Returns a content type by mime type, or null if none found
      • getExtension

        public String getExtension()
      • getMimeType

        public String getMimeType()
      • isBinary

        public boolean isBinary()