Java Reference
In-Depth Information
L ISTING D.8 Continued
public PageFormat showPageFormatDialog(PageFormat p) {
return job.pageDialog(p);
}
}
PersistenceServiceImpl
The class detailed in Listing D.9 implements the JNLP 1.0 runtime persistence services by
means of files saved on the local filesystem. All these files are rooted under the “ .jnlpImpl
directory under the user home. On Windows machines such a directory is located in the
Windows system directory and it is created on-the-fly.
C AUTION
The current implementation is not compatible with other JNLP Clients' implementa-
tions. This class cannot read data saved via the JNLP runtime API by another JNLP
Client, because it relies on a different, file-based caching mechanism.
L ISTING D.9 The Persistence ServiceImpl Class
package com.marinilli.b2.ad.util;
import java.net.URL;
import javax.jnlp.FileContents;
import javax.jnlp.PersistenceService;
import java.io.File;
/**
* Appendix D
*
* @author Mauro Marinilli
* @version 1.0
*/
public class PersistenceServiceImpl implements PersistenceService {
public final static String SUPPORT_DIR = “.jnlpImpl”;
private static File sysDir = new File(System.getProperty(“user.home”) +
File.separatorChar + SUPPORT_DIR);
/**
* Constructor
Search WWH ::




Custom Search