|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jApp.jdic.AssociationService
public class AssociationService
Provides a service to register file/document types and associate them with an application so that both the application and the files/documents have the correct appearance (icon) and can be launched/opened by double clicking at the icon on the Desktop.
Supports modern Windows (NT based, such as 2000 and XP) and Linux (at least KDE/Gnome 3.0) platforms. MacOS X does not require this service as this is best handled through '.app' and '.plist' packaging on that platform.
This is done in 100% pure Java as registration is done using command line interface to the underlaying operating system usin Runtime.getRuntime().exec() method. More specifically, using REG.EXE on Windows and XDG Util scripts on Linux. In Linux, the commands are 'sudo':ed if a root/admin password is provided.
Constructor Summary | |
---|---|
AssociationService()
|
Method Summary | |
---|---|
static void |
copyResourceToFile(java.lang.Class clss,
java.lang.String resource,
java.io.File toFile)
Copies a resorce to a file. |
void |
register(boolean install,
boolean systemInstall,
java.lang.String password,
java.lang.Class mainClass,
java.lang.Class resourceClass,
java.lang.String applicationID,
java.lang.String applicationName,
java.lang.String description,
java.lang.String applicationDir,
java.lang.Iterable<Association> associations)
Registers/unregister the application and file associations with the platforms Desktop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AssociationService()
Method Detail |
---|
public static void copyResourceToFile(java.lang.Class clss, java.lang.String resource, java.io.File toFile) throws java.io.IOException
clss
- resource
- toFile
-
java.io.IOException
public void register(boolean install, boolean systemInstall, java.lang.String password, java.lang.Class mainClass, java.lang.Class resourceClass, java.lang.String applicationID, java.lang.String applicationName, java.lang.String description, java.lang.String applicationDir, java.lang.Iterable<Association> associations) throws java.lang.Exception
install
- weather to install or uninstallsystemInstall
- install into system or for the user (Linux only)password
- the root (admin) password for 'sudo'ing the regisration (Linux only)mainClass
- the mainClass of the applicationresourceClass
- the class that contains the resources (icons)applicationID
- the internal name for the application (used as key in regisration)applicationName
- the user name for the applicationdescription
- the user description of the applicationapplicationDir
- the directory used to store registration related files, needs to be writableassociations
- list of associations to register
java.lang.Exception
- if something goes wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |