Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  persistant preferences with web start  (Read 3687 times)
0 Members and 1 Guest are viewing this topic.
Offline markuskidd

Junior Devvie

Medals: 1

« Posted 2002-12-22 00:38:48 »

I am considering switching to web start for deploying my application so that I can take advantage of it's built-in auto-updating features, but I am trying to locate information on the preferred method of storing stuff like the player's preferences, or perhaps chat logs, etc. Should I just ask for permission to create a folder on their drive and store it there?
Offline leknor

Junior Devvie


« Reply #1 - Posted 2002-12-22 03:52:21 »

Have you tried the stuff in the java.util.prefs package yet? From the java.util. prefs package description:
This package allows applications to store and retrieve user and system preference and configuration data. This data is stored persistently in an implementation-dependent backing store. There are two separate trees of preference nodes, one for user preferences and one for system preferences.
I don't know if it will work, I haven't used JWS yet.
Offline markuskidd

Junior Devvie

Medals: 1

« Reply #2 - Posted 2002-12-22 04:28:11 »

I looked at it, and I think that most or all of the classes are abstract, and are meant to be frontends for database-driven storage that you or (if there are libraries out there for this) someone else implement. The same question about where to stick the files would still apply. Is there a 'standard' or canonical place that JWS coders put this kind of thing? I feel like just creating a directory in the root of my user's hard drive space is a bit unfriendly and presumptious  Grin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline leknor

Junior Devvie


« Reply #3 - Posted 2002-12-22 04:50:01 »

The classes are astract because they encourage custom implementations but that doesn't matter, each JVM comes with a default implementation and you can access it with the static method at: java.util.prefs.Preferences.userRoot() . Now the question is how does this behave in the context of JWS?
Offline markuskidd

Junior Devvie

Medals: 1

« Reply #4 - Posted 2002-12-22 05:26:24 »

Missed that on my glance-through, but the docs still raise more questions than they answer. Even outside of JWS, I wonder where/how this information is stored:


Typical implementations include flat files, OS-specific registries, directory servers and SQL databases.

I need to google for some more info in the morning..
Offline leknor

Junior Devvie


« Reply #5 - Posted 2002-12-22 22:54:54 »

And the next sentence after the one you quote is:
The user of this class needn't be concerned with details of the backing store.

Anyway, just do something and abstract your code in such a way that you can change how preferences are manages easily and can do it some other way if you get complaints.
Offline markuskidd

Junior Devvie

Medals: 1

« Reply #6 - Posted 2002-12-23 05:26:34 »

I'd rather not use it if I knew it was going to dump data in the system registry, for eample. And it would be good to know where a flatfile database would be created. Could this class hijack an SQL server that is running on a user if it allows anonymous access? Every option mentioned potentially has serious drawbacks Cheesy

By this time, I could have written a test program. What a loser I am  Cool
Offline Herko_ter_Horst

Senior Newbie

Java games rock!

« Reply #7 - Posted 2002-12-24 10:59:41 »

The default implementation on Windows will indeed use the registry to store preferences. I think on Linux a file-based solution is used. It should be possible (at the expense of more code to download, of course) to roll your own always-file-based solution.

I like the prefs package, it's easy to use as-is and does what I want most of the time.
Offline JohnMunsch

Junior Newbie

Founder of

« Reply #8 - Posted 2003-01-02 15:28:52 »

I think the answer to the question of "what does it do under Web Start" is that it depends upon what permissions your WS app has asked for.

If you've asked for full permissions and you've specified that your WS app needs 1.4 to run then you should be able to use any 1.4 API you desire. On the other hand, if you are not asking for permissions in your JNLP file then you are very restricted in what you can call. So you will probably have to use the WS mechanism for persistent storage. It is called muffins and is similar to the cookies mechanism that servers are allowed to use with browsers when they communicate via HTTP.

Personally, I'd rather use the 1.4 preferences stuff.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

bilznatch (24 views)
2015-08-04 11:03:17

SHC (39 views)
2015-08-01 03:58:20

Jesse (24 views)
2015-07-29 04:35:27

Riven (45 views)
2015-07-27 16:38:00

Riven (25 views)
2015-07-27 15:35:20

Riven (27 views)
2015-07-27 12:26:13

Riven (18 views)
2015-07-27 12:23:39

BurntPizza (41 views)
2015-07-25 00:14:37

BurntPizza (53 views)
2015-07-24 22:06:39

BurntPizza (33 views)
2015-07-24 06:06:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!