0

I'm not new to Java..

OK so let's say I have an applet accessable from http://test.com...

I want to load a text file (and if not... create) but not load from Desktop or Documents because everyone has different path... so where would be the best way to put.

Have the applet store a .zip file of .txt files somewhere? I'm lost...

If you've played Minecraft and know about it... they store your map and items in your temp folder... so something like that. heh.

Thanks.

2 Answers 2

1

Java applets run in a very restricted environment. Accessing the local file system can be done, but requires signing and other considerations. To store applet data, your best bet is to use the Applet Persistence API, described here.

Sign up to request clarification or add additional context in comments.

2 Comments

Then you can probably use the file system, provided that the cert was issued by a certificate authority that the browser recognizes. I still think that unless you need to communicate data outside the applet, using the persistence api is less likely to run into problems.
Persistance API, here I come. Thanks.
1

You can store your files in temp directory accessed by

TEMP_PATH = System.getProperty("java.io.tmpdir")

1 Comment

Could you create text files and put in the desired folders in TEMP?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.