This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applets and filereading

 
Mikael Bjorkman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that an applet is not allowed to read or write files on the local system, but is it possible to write and read to/from a textfile on the same server it was downloaded from?
I would need this to transfer parameters to and from the applet.
I would really appreciate any help on this.
Thanks
Mike
 
Tanveer Rameez
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I think you can read and write to files in the same server if it is in the same folder or sub-directory as that of the applet.Use the ordinary FileInputStram or you can use URL to hold the address of the file and then access it thru DataOutputStream.
hope this helps
bye
Tanveer
 
Grant Crofton
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, you should be able to do it like this:

or you can use a DataInputStream or whatever, as long as you open it with 'url.openStream()'.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic