The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Deployment
Lesson: Java Web Start

The JNLP API

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.jnlp  (in the API reference documentation) package, which is delivered in the jnlp.jar as part of te Java Development Kit version 5.0, in the sample/jnlp/servlet directory. The javax.jnlpjavaws.jar, which is located in the JRE's lib directory.

The following table provides an overview of the main interfaces and classes in the javax.jnlp package. For more information, see the API documentation and the Java Web Start Guide  (in the API reference documentation).

Interfaces and Classes in the javax.jnlp Package
Interface or Class Description
BasicService  (in the API reference documentation) Provides 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
ClipboardService  (in the API reference documentation) Provides methods for copying contents to and from the client system's clipboard.

Warning : The ClipboardService interface works for applications running in a sandbox. Therefore Java Web Start warns users of the potential security risk of allowing an untrusted application to access the system clipboard, and possibly confidential information.
DownloadService  (in the API reference documentation) Provides the ability to control how the application's resources are cached.
ExtendedService  (in the API reference documentation) Provides additional support to the current JNLP API. It allows applications to open specific file(s) in the client's file system.
FileContents  (in the API reference documentation) Encapsulates the name and contents of a file. An object of this class is used by the FileOpenService, FileSaveService and PersistenceService interfaces.
FileOpenService  (in the API reference documentation) Provides the ability for applications to open files on the local file system.
FileSaveService  (in the API reference documentation) Provides 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.

JNLPRandomAccessFile  (in the API reference documentation) Supports 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.
PersistenceService  (in the API reference documentation) Provides 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.

PrintService  (in the API reference documentation) Provides 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.

SingleInstanceService  (in the API reference documentation) Provides 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.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.