public class FreeDesktopMimeActionsHandler extends java.lang.Object implements MimeActionsHandlerI
This class parses mimeapps.list and .desktop files to determine
which application should handle a specific file type (MIME type).
It resolves standard XDG directories (User and System) to find the appropriate "Exec" command.
| Constructor and Description |
|---|
FreeDesktopMimeActionsHandler()
Constructor: Initializes the handler by scanning default directories and parsing MIME mappings.
|
| Modifier and Type | Method and Description |
|---|---|
MimeActionI[] |
getAllActionsForType(java.lang.String type)
Retrieves all actions associated with a MIME type.
|
MimeActionI |
getDefaultActionForType(java.lang.String type)
Locates the default application for a given MIME type.
|
static void |
main(java.lang.String[] args)
Main entry point for testing purposes.
|
public FreeDesktopMimeActionsHandler()
public static void main(java.lang.String[] args)
args - Command line arguments (unused)public MimeActionI[] getAllActionsForType(java.lang.String type)
Note: Current implementation implies only the Default action is returned.
FIXME! TH 2026-02-03: Reading the mimeinfo.cache would be much faster than iterating every .desktop file to see what MIME types it supports.getAllActionsForType in interface MimeActionsHandlerItype - The MIME type (e.g. "image/png")public MimeActionI getDefaultActionForType(java.lang.String type)
getDefaultActionForType in interface MimeActionsHandlerItype - The MIME type to look up.Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.