PersistenceService in JAWS

  • Thread starter Mike Westerfield
  • Start date
M

Mike Westerfield

I'm trying to use PersistenceService from an application launched from
JAWS in Windows XP using Java 1.4.2 to store some user preferences. I
get an error trying to open an output stream like this:

final BasicService basic = (BasicService)
ServiceManager.lookup("javax.jnlp.BasicService");
URL cookie = new URL(basic.getCodeBase(), "cookie.txt");
final PersistenceService service = (PersistenceService)
ServiceManager.lookup("javax.jnlp.PersistenceService");
final PrintStream out = new PrintStream(new
BufferedOutputStream(service.get(cookie).getOutputStream(true)));

The path returned by service.get(cookie).getName() shows a path I did
not expect. Instead of the JAWS cache with the url expanded as
directories, which is where JAWS stores the jar file, the path had the
directory name \muffins\ inserted between the cache directory path and
the url portion of the path. Even when I created this path by hand, I
still got a file not found exception from the above code.

The application is signed, so I'll use the option of creating the path
and output stream using File objects, but I am curious: what is wrong
with this method of opening an output stream for a JAWS application
cookie?

Mike Westerfield
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top