The Java platform includes the JNLP API to enable you to provide additional information to applications deployed through Java Web Start.The JNLP API is included in the
javax.jnlppackage, which is delivered in thejnlp.jaras part of te Java Development Kit version 6, in thesample/jnlp/servletdirectory. Thejavax.jnlppackage is also delivered in thejavaws.jar, which is located in the JRE'slibdirectory.The following table provides an overview of the main interfaces and classes in the
javax.jnlppackage. For more information, see the API documentation and the Java Web Start Guide .
Warning : Java Web Start warns users of the following Interfaces and Classes about the potential security risk of allowing an untrusted application to access the file system, use the system printer, use the system clipboard, or increase the disk space used by the PersistenceService.
Interfaces and Classes in the javax.jnlpPackageInterface or Class Description BasicServiceProvides methods for:
- Determining the codebase of the application
- Determining whether the application is online or not
- Determining whether a Web browser is supported on the current platform and by the JNLP client.
- Opening a specific URL in the browser
ClipboardServiceProvides methods for copying contents to and from the client system's clipboard. The ClipboardServiceinterface works for applications running in a sandbox.DownloadServiceProvides the ability to control how the application's resources are cached. ExtendedServiceProvides additional support to the current JNLP API. It allows applications to open specific file(s) in the client's file system. FileContentsEncapsulates the name and contents of a file. An object of this class is used by the FileOpenService,FileSaveServiceandPersistenceServiceinterfaces.FileOpenServiceProvides the ability for applications to open files on the local file system. FileSaveServiceProvides methods for exporting files to the local disk, even for applications that are running in the restricted execution environment. Note: This interface provides the same level of disk access to potentially untrusted Web-deployed applications that a Web browser provides for content it displays through its Save As . . . dialog box.
JNLPRandomAccessFileSupports reading from and writing to a random access file. A random access file behaves like a large array of bytes stored in the file system. PersistenceServiceProvides methods for storing data locally on the client system, even for applications that are running in a sandbox. Note: This service is similar to the cookie mechanism for HTML-based applications. Cookies allow a small amount of data to be stored locally on the client system. That data can be securely managed by the browser and can only be retrieved by HTML pages which originate from the same URL as the page that stored the data.
PrintServiceProvides methods for access to printing, even for applications that are running in the restricted execution environment. Note: Starting with Java Web Start 5.0, you can use the Java Printing APIs, so there is no need to use this interface. If the application is running in a sandbox, Java Web Start opens a security dialog box asking the user for permission to print.
SingleInstanceServiceProvides a set of methods for applications to register themselves as singletons, and to register listener(s) for handling arguments passed in from different instances of applications.