GeeCON Prague 2014*
The moose likes Applets and the fly likes applet writing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Applets
Bookmark "applet writing" Watch "applet writing" New topic
Author

applet writing

Rakesh Kumar
Ranch Hand

Joined: May 30, 2006
Posts: 63
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
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
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?


Ping & DNS - my free Android networking tools app
Andrew Thompson
Ranch Hand

Joined: Aug 05, 2010
Posts: 77
    
    5
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').


Andrew Thompson
http://pscode.org/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: applet writing