Class MimeUtils

java.lang.Object
uno.anahata.ai.nb.mime.MimeUtils

public final class MimeUtils extends Object
Utility class for working with MIME types and file extensions in NetBeans.
  • Method Details

    • getAllMimeTypes

      public static Set<String> getAllMimeTypes()
      Scans the NetBeans System Filesystem's "Editors" folder to find all registered MIME types. This is the most reliable method to get a complete list of MIME types the IDE is aware of.
      Returns:
      A Set of all registered MIME type strings.
    • getExtensionToMimeTypeMap

      public static Map<String,String> getExtensionToMimeTypeMap()
      Scans the NetBeans System Filesystem to find all registered MIME types and their file extensions, returning a map where the key is the extension and the value is the MIME type. If an extension is associated with multiple MIME types, the last one found will be stored.
      Returns:
      A Map of file extensions to their corresponding MIME types.