net.sourceforge.jnlp.services

## Class ServiceUtil

- java.lang.Object
- - net.sourceforge.jnlp.services.ServiceUtil

    public class ServiceUtil
    extends java.lang.Object

Provides static methods to interact useful for using the JNLP services.

### Constructor Summary

Constructors
Constructor and Description
`ServiceUtil()`

### Method Summary

Methods
`static boolean` `checkAccess(ApplicationInstance app, SecurityDialogs.AccessType type, java.lang.Object... extras)` Returns whether the app requesting a JNLP service has the right permissions.
`static boolean` `checkAccess(SecurityDialogs.AccessType type, java.lang.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 running
`static BasicService` `getBasicService()` Returns the BasicService reference, or null if the service is unavailable.
`static ClipboardService` `getClipboardService()` Returns the ClipboardService reference, or null if the service is unavailable.
`static DownloadService` `getDownloadService()` Returns the DownloadService reference, or null if the service is unavailable.
`static ExtensionInstallerService` `getExtensionInstallerService()` Returns the ExtensionInstallerService reference, or null if the service is unavailable.
`static FileOpenService` `getFileOpenService()` Returns the FileOpenService reference, or null if the service is unavailable.
`static FileSaveService` `getFileSaveService()` Returns the FileSaveService reference, or null if the service is unavailable.
`static PersistenceService` `getPersistenceService()` Returns the PersistenceService reference, or null if the service is unavailable.
`static PrintService` `getPrintService()` Returns the PrintService reference, or null if the service is unavailable.
`static SingleInstanceService` `getSingleInstanceService()` Returns the SingleInstanceService reference, or null if the service is unavailable.
`static boolean` `isSigned(ApplicationInstance app)` Returns whether the app requesting a JNLP service is a trusted application

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ServiceUtil

    public ServiceUtil()

### 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.

#### 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` - the `JNLPFile` that 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 requested
  `extras` - 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 requested
  `extras` - 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