Class FileTypeResolver

  • All Implemented Interfaces:
    Serializable

    @Deprecated
    public class FileTypeResolver
    extends FileTypeResolver
    implements Serializable
    Deprecated.
    Only used for compatibility-server
    Utility class that can figure out mime-types and icons related to files.

    Note : The icons are associated purely to mime-types, so a file may not have a custom icon accessible with this class.

    Since:
    3.0
    Author:
    Vaadin Ltd.
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_ICON

        public static Resource DEFAULT_ICON
        Deprecated.
        Default icon given if no icon is specified for a mime-type.
    • Method Detail

      • getIcon

        public static Resource getIcon​(String fileName)
        Deprecated.
        Gets the descriptive icon representing file, based on the filename. First the mime-type for the given filename is resolved, and then the corresponding icon is fetched from the internal icon storage. If it is not found the default icon is returned.
        Parameters:
        fileName - the name of the file whose icon is requested.
        Returns:
        the icon corresponding to the given file
      • getIcon

        public static Resource getIcon​(File file)
        Deprecated.
        Gets the descriptive icon representing a file. First the mime-type for the given file name is resolved, and then the corresponding icon is fetched from the internal icon storage. If it is not found the default icon is returned.
        Parameters:
        file - the file whose icon is requested.
        Returns:
        the icon corresponding to the given file
      • addIcon

        public static void addIcon​(String mimeType,
                                   Resource icon)
        Deprecated.
        Adds a icon for the given mime-type. If the mime-type also has a corresponding icon, it is replaced with the new icon.
        Parameters:
        mimeType - the mime-type whose icon is to be changed.
        icon - the new icon to be associated with MIMEType.
      • getMIMETypeToIconMapping

        public static Map<String,​Resource> getMIMETypeToIconMapping()
        Deprecated.
        Gets the internal mime-type to icon mapping.
        Returns:
        unmodifiable map containing the current mime-type to icon mapping