2

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.

4

1 回答 1

1

setMaxLength设置最大长度可能成功也可能失败 - 您必须检查返回值以确定实际授予了多少空间。

未签名的应用程序并不总是被授予他们请求的全部数量(Sun 实现中的默认限制是 128Kb。)如果他们请求的数量超过当前限制,那么

  1. 提示用户许可
  2. 如果用户授予权限,那么对于所有未签名的应用程序和小程序,限制会在全局范围内增加。

已签名的应用程序会自动授予最高 2Gb 而不会提示。

没有用于编辑默认限制的 UI。它存储在一个名为deployment.properties. 此页面显示该文件在各种操作系统下的位置。

于 2011-11-25T21:53:55.890 回答