Question

I'm looking at JNLP to see if it's a better way to package an applet that saves data to a local file.

Does anyone have any data on what limits browsers (or JVM implementations?) place on the size of files you can create via the JNLP PersistenceService? There doesn't seem to be any information readily available apart from the recommendation that a PersistenceService implementation "provides methods to get the current storage usage and limits and to request more storage", but I can't find any such methods in the javadocs...

The FileContents class has getMaxLength and setMaxLength methods but the descriptions of these are ambiguous and seem to imply (to me) that the client app can set the max length.

Était-ce utile?

La solution

setMaxLength may or may not succeed in setting the max length - you have to check the return value to determine how much space was actually granted.

Unsigned applications are not always granted the full amount they request (the default limit in Sun's implementation is 128Kb.) If they request more than the current limit then

  1. The user is prompted for permission
  2. If the user grants permission then the limit is increased globally, for all unsigned applications and applets.

Signed applications are automatically granted up to 2Gb without prompting.

There is no UI to edit the default limit. It is stored in a configuration file called deployment.properties. This page shows locations for that file under various operating systems.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top