Direct file access by java applet

98 Views Asked by At

I need to know whether an applet could use direct file access functionality, NOT via JNLP.

Is it possible for applet to access files via standard file classes:

  • java.nio.file.Files;
  • java.io.FileInputStream;

Is this possible for "Next Generation applet"?

Is this possible for pre "Next Generation applet"?

1

There are 1 best solutions below

3
Elliott Frisch On

Yes. If it is a signed and privileged (the user allows it) applet.

What Applets Can and Cannot Do says (in part)

Applets are either sandbox applets or privileged applets. Sandbox applets are run in a security sandbox that allows only a set of safe operations. Privileged applets can run outside the security sandbox and have extensive capabilities to access the client.

Applets that are not signed are restricted to the security sandbox, and run only if the user accepts the applet. Applets that are signed by a certificate from a recognized certificate authority can either run only in the sandbox, or can request permission to run outside the sandbox. In either case, the user must accept the applet's security certificate, otherwise the applet is blocked from running.