Package com.install4j.api.windows
Class WinAssociations
java.lang.Object
com.install4j.api.windows.WinAssociations
Collection of static methods to create and remove file associations
on Microsoft Windows.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCreates a file association.static booleanChecks whether a file association already exists.static StringgetExecutable(String extension) Retrieves the executable associated with an extension.static voidRemoves a file association.
-
Method Details
-
create
Creates a file association.- Parameters:
extension- the extension including the leading dot (e.g. ".doc").description- a description of the file type.iconFile- the icon file for the document. May be null.executable- the executable that shall be called with the file as parameter.
-
exists
Checks whether a file association already exists.- Parameters:
extension- the extension including the leading dot (e.g. ".doc").- Returns:
- true if an association exists
-
getExecutable
Retrieves the executable associated with an extension.- Parameters:
extension- the extension including the leading dot (e.g. ".doc").- Returns:
- the executable associated with the given extension. Null if there is no association.
-
remove
Removes a file association.- Parameters:
extension- the extension including the leading dot (e.g. ".doc").
-