Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet writing

 
Rakesh Kumar
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,
I want to save a data fro applet to a ext file in a folder near to the applet jar. I mean applet jat and new file folder are in same folder. If the new folder is in desktop also it is ok. Please share your knowledge about this.
thanks
raghavendra
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For security reasons, applets are not allowed access to the local file system unless you take special steps to allow that. Furthermore applets reside on a server to which the applet has no file I/O access to begin with (I mention this because you're talking of "in the same folder").

Maybe a WebStart application -or even a standalone desktop application- would be better suited for this task?
 
Andrew Thompson
Ranch Hand
Posts: 77
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:For security reasons, applets are not allowed access to the local file system unless you take special steps to allow that. Furthermore applets reside on a server to which the applet has no file I/O access to begin with (I mention this because you're talking of "in the same folder").

Maybe a WebStart application -or even a standalone desktop application- would be better suited for this task?


Local File System
By default, JWS applications are subject to the same security restrictions as applets. But JWS apps. have access to the JNLP API, which provides the FileContents object available through the FileOpenService and FileOpenService. Here is a demo of the file services.

As of Sun's Next Generation Plug-In2, embedded applets can be configured using JWS & have access to the JNLP API.

Server File system
None of an applet or JWS app. (sand-boxed or trusted), or a plain application (no security manager) can write to a place on the server without help from the server. If the server provides a public interface to allow file upload, it can be accessed by a sand-boxed app. if the app. comes from the same server ('phone home').
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic