Package net.sourceforge.jnlp.services
Class ServiceUtil
- java.lang.Object
-
- net.sourceforge.jnlp.services.ServiceUtil
-
public class ServiceUtil extends java.lang.ObjectProvides static methods to interact useful for using the JNLP services.
-
-
Constructor Summary
Constructors Constructor Description ServiceUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckAccess(ApplicationInstance app, SecurityDialogs.AccessType type, java.lang.Object... extras)Returns whether the app requesting a JNLP service has the right permissions.static booleancheckAccess(SecurityDialogs.AccessType type, java.lang.Object... extras)Returns whether the app requesting a JNLP service has the right permissions.static voidcheckExistingSingleInstance(JNLPFile jnlpFile)Checks that this application (represented by the jnlp) isnt already runningstatic BasicServicegetBasicService()static ClipboardServicegetClipboardService()static DownloadServicegetDownloadService()static DownloadService2getDownloadService2()static ExtensionInstallerServicegetExtensionInstallerService()static FileOpenServicegetFileOpenService()static FileSaveServicegetFileSaveService()static PersistenceServicegetPersistenceService()static PrintServicegetPrintService()static SingleInstanceServicegetSingleInstanceService()static booleanisSigned(ApplicationInstance app)Returns whether the app requesting a JNLP service is a trusted application
-
-
-
Method Detail
-
getBasicService
public static BasicService getBasicService()
- Returns:
- the BasicService reference, or null if the service is unavailable.
-
getClipboardService
public static ClipboardService getClipboardService()
- Returns:
- the ClipboardService reference, or null if the service is unavailable.
-
getDownloadService
public static DownloadService getDownloadService()
- Returns:
- the DownloadService reference, or null if the service is unavailable.
-
getDownloadService2
public static DownloadService2 getDownloadService2()
- Returns:
- the DownloadService reference, or null if the service is unavailable.
-
getExtensionInstallerService
public static ExtensionInstallerService getExtensionInstallerService()
- Returns:
- the ExtensionInstallerService reference, or null if the service is unavailable.
-
getFileOpenService
public static FileOpenService getFileOpenService()
- Returns:
- the FileOpenService reference, or null if the service is unavailable.
-
getFileSaveService
public static FileSaveService getFileSaveService()
- Returns:
- the FileSaveService reference, or null if the service is unavailable.
-
getPersistenceService
public static PersistenceService getPersistenceService()
- Returns:
- the PersistenceService reference, or null if the service is unavailable.
-
getPrintService
public static PrintService getPrintService()
- Returns:
- the PrintService reference, or null if the service is unavailable.
-
getSingleInstanceService
public static SingleInstanceService getSingleInstanceService()
- Returns:
- the SingleInstanceService reference, or null if the service is unavailable.
-
checkExistingSingleInstance
public static void checkExistingSingleInstance(JNLPFile jnlpFile)
Checks that this application (represented by the jnlp) isnt already running- Parameters:
jnlpFile- theJNLPFilethat specifies the application- Throws:
InstanceExistsException- if an instance of this application already exists
-
checkAccess
public static boolean checkAccess(SecurityDialogs.AccessType type, java.lang.Object... extras)
Returns whether the app requesting a JNLP service has the right permissions. If it doesn't, user is prompted for permissions. This method should only be used for JNLP API related permissions.- Parameters:
type- the type of access being requestedextras- extra Strings (usually) that are passed to the dialog for message formatting.- Returns:
- true if the access was granted, false otherwise.
-
checkAccess
public static boolean checkAccess(ApplicationInstance app, SecurityDialogs.AccessType type, java.lang.Object... extras)
Returns whether the app requesting a JNLP service has the right permissions. If it doesn't, user is prompted for permissions. This method should only be used for JNLP API related permissions.- Parameters:
app- the application which is requesting the check. If null, the current application is used.type- the type of access being requestedextras- extra Strings (usually) that are passed to the dialog for message formatting.- Returns:
- true if the access was granted, false otherwise.
-
isSigned
public static boolean isSigned(ApplicationInstance app)
Returns whether the app requesting a JNLP service is a trusted application- Parameters:
app- the application which is requesting the check. If null, the current application is used.- Returns:
- true, if the app is a trusted application; false otherwise
-
-