- java.lang.Object
-
- org.scijava.desktop.platform.linux.LinuxSchemeInstaller
-
- All Implemented Interfaces:
SchemeInstaller
public class LinuxSchemeInstaller extends Object implements SchemeInstaller
Linux implementation ofSchemeInstallerusing .desktop files.This implementation modifies the application's .desktop file to add URI scheme handlers via the MimeType field, then registers them using xdg-mime.
- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description LinuxSchemeInstaller(Path desktopFilePath, org.scijava.log.LogService log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetInstalledPath(String scheme)Gets the executable path registered for a given scheme.voidinstall(String scheme, String executablePath)Installs a URI scheme handler in the operating system.booleanisInstalled(String scheme)Checks if a URI scheme is already registered.booleanisSupported()Checks if this installer is supported on the current platform.voiduninstall(String scheme)Uninstalls a URI scheme handler from the operating system.
-
-
-
Constructor Detail
-
LinuxSchemeInstaller
public LinuxSchemeInstaller(Path desktopFilePath, org.scijava.log.LogService log)
-
-
Method Detail
-
isSupported
public boolean isSupported()
Description copied from interface:SchemeInstallerChecks if this installer is supported on the current platform.- Specified by:
isSupportedin interfaceSchemeInstaller- Returns:
- true if the installer can run on this OS
-
install
public void install(String scheme, String executablePath) throws IOException
Description copied from interface:SchemeInstallerInstalls a URI scheme handler in the operating system.- Specified by:
installin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to register (e.g., "myapp")executablePath- The absolute path to the executable to launch- Throws:
IOException- if installation fails
-
isInstalled
public boolean isInstalled(String scheme)
Description copied from interface:SchemeInstallerChecks if a URI scheme is already registered.- Specified by:
isInstalledin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to check- Returns:
- true if the scheme is already registered
-
getInstalledPath
public String getInstalledPath(String scheme)
Description copied from interface:SchemeInstallerGets the executable path registered for a given scheme.- Specified by:
getInstalledPathin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to query- Returns:
- The registered executable path, or null if not registered
-
uninstall
public void uninstall(String scheme) throws IOException
Description copied from interface:SchemeInstallerUninstalls a URI scheme handler from the operating system.- Specified by:
uninstallin interfaceSchemeInstaller- Parameters:
scheme- The URI scheme to unregister- Throws:
IOException- if uninstallation fails
-
-