Skip to main content
gamedev.net
🔒 Locked

[java] filePermission

Started by n0rmanfreak Apr 11, 2003 at 2:05 PM 5 replies 500+ views
Original Post
n0rmanfreak
n0rmanfreak
hi! i made an applet but i got difficulties with file permission if running at a browser. i have all my source inside a jar. and another file at the same directory i want to load and save. but i don''t know how to set the permissions to do so. any help would be welcome i want to run it via the internet. thx
fractionMan
fractionMan
Here it is, complete with my comment from the last applet that I had to do this with. This will get something from the same driectory as the jar file.

  
/** bloody hell... That took ages to get right */
ClassLoader loader = this.getClass().getClassLoader();
BufferedReader is = new BufferedReader(new InputStreamReader(loader.getResourceAsStream("data.txt")));

fractionMan
fractionMan
Open a buffered writer as well as a reader?
fractionMan
fractionMan
Oh. I''m not sure about that then. Sorry.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.