Package net.sourceforge.jnlp.services
Class ServiceUtil
java.lang.Object
net.sourceforge.jnlp.services.ServiceUtil
Provides static methods to interact useful for using the JNLP
services.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkAccess
(ApplicationInstance app, SecurityDialogs.AccessType type, Object... extras) Returns whether the app requesting a JNLP service has the right permissions.static boolean
checkAccess
(SecurityDialogs.AccessType type, Object... extras) Returns whether the app requesting a JNLP service has the right permissions.static void
checkExistingSingleInstance
(JNLPFile jnlpFile) Checks that this application (represented by the jnlp) isnt already runningstatic BasicService
static ClipboardService
static DownloadService
static DownloadService2
static ExtensionInstallerService
static FileOpenService
static FileSaveService
static PersistenceService
static PrintService
static SingleInstanceService
static boolean
Returns whether the app requesting a JNLP service is a trusted application
-
Constructor Details
-
ServiceUtil
public ServiceUtil()
-
-
Method Details
-
getBasicService
- Returns:
- the BasicService reference, or null if the service is unavailable.
-
getClipboardService
- Returns:
- the ClipboardService reference, or null if the service is unavailable.
-
getDownloadService
- Returns:
- the DownloadService reference, or null if the service is unavailable.
-
getDownloadService2
- Returns:
- the DownloadService reference, or null if the service is unavailable.
-
getExtensionInstallerService
- Returns:
- the ExtensionInstallerService reference, or null if the service is unavailable.
-
getFileOpenService
- Returns:
- the FileOpenService reference, or null if the service is unavailable.
-
getFileSaveService
- Returns:
- the FileSaveService reference, or null if the service is unavailable.
-
getPersistenceService
- Returns:
- the PersistenceService reference, or null if the service is unavailable.
-
getPrintService
- Returns:
- the PrintService reference, or null if the service is unavailable.
-
getSingleInstanceService
- Returns:
- the SingleInstanceService reference, or null if the service is unavailable.
-
checkExistingSingleInstance
Checks that this application (represented by the jnlp) isnt already running- Parameters:
jnlpFile
- theJNLPFile
that specifies the application- Throws:
InstanceExistsException
- if an instance of this application already exists
-
checkAccess
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, 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
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
-