1

I need a Java applet framework or something like that for syncing files between server and local machine through browser. Of course I can make that applet myself, but maybe someone has already seen or done that applet.

Are there any Java applet frameworks for accessing the local file system through a browser?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Andre
  • 79
  • 1
  • 3
  • 6
  • I expect, that user can select the directory on his local machine, and it syncing with directory on server. It must work like dropbox client. But if dropbox syncing files automaticaly, in my case user start syncing manually through browser. – Andre Mar 28 '12 at 11:56
  • So, I want to solve it using signed applet, and I want to find existing applet or component or framework or something else that already implemented my requirements. – Andre Mar 28 '12 at 14:04
  • another words, I need only a bridge between local file system and browser. All UI has built on html and javascript. I just want to call method (e.g. getRootDirectories()) from applet through javascript and get list of directories. Or call (e.g. createFile('/home/username/', "http://myserver/file.txt")) and applet must create file on local file system. – Andre Mar 28 '12 at 14:14

2 Answers2

2

See the Applet info. page for references to 'Next Generation'. Since the Next Generation plug-in, even sand-boxed embedded applets can access the local file-system (with the permission of the user, when prompted).

Next Gen. applets:

  • Can be deployed using Java Web Start (while still embedded in a web page).
  • Can therefore access the JNLP API, which provides things like the JNLP file services (which offers sand-boxed access to the local file-system). Here is a demo. of the file services it is based around a frame & free-floating, you can download the source and build files. And here is GIFanim: a sand-boxed, embedded applet that can load images off the local file-system (chosen by the user) to make animated GIFs (which it can then save back to the local file-system).

Prior to the Next Gen. plug-in, applets could access the local file-system in 3 ways:

  • Trusted applet (signed by developer, accepted by the user when prompted).
  • Editing policy files (not recommended for developers, let alone end users).
  • A free floating applet deployed using JWS (odd looking, might as well just use a frame).
Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • So, I know how it make with myself, but I've just been searching completed applet or component – Andre Mar 28 '12 at 14:19
1

By default an applet can't access the local file system. This article discusses the issue. Basically, you need to sign the applet or do some local configuration to turn off the restrictions you can't live with. My advice is to turn off only the restrictions you REALLY need.

Jim Blizard
  • 4,255
  • 28
  • 37
  • This was slightly wrong prior to the Next Gen plug-in (a sand-boxed applet deployed free-floating using JWS could access the file-system) and more wrong since the Next Gen. plug-in. See my answer. – Andrew Thompson Mar 28 '12 at 00:01