Hello,
I am developing a time series forecaster in java. Ideally, I want it to run client side as a Java applet. In this applet, I need to load data from an external file. Is there a way an applet can open files for reading that are on the server that the applet was downloaded from? I have not tried it yet, but I believe this violates Java's sandbox (heaven forbid I start doing applet signing, certificates, etc...). I know I can write a server that the applet will connect to and download the data, but that seems like too much trouble (plus my Linux box just died so I don't have my own server anymore). Anybody know if it's possible?
Summary: I need to know if I can open and read files with an applet - the applet and file I need to open are both on the same server.
Thanks in advance for any help!
EZ-E
<edit>
Well... I tried to sleep, and I couldn't think of anything but this problem since it pretty much stops my research dead in it's tracks. Anyways, somehow this solution popped into my head and seems to serve the purpose. I'll post it here in case anybody else needs it... or there is something wrong with what I'm doing (somebody will correct me right?

):
As long as the applet source is from the same place (server) as the data file, you can (if the source is not the same as the server, it will generate a security exception) do this:
Code:
URL dataStream = new URL("http://someURLWhereYourAppletIs/dataFileName");
BufferedReader in = new BufferedReader(new InputStreamReader(dataStream.openStream()));
String str;
while((str = in.readLine()) != null) {
//... do your processing in here
}
Is it a too simple solution to be true? I've tested it already and it seems to work. Guess this kinda circumvents the sandbox (through a degree of separation) since the page that you access via the URL class can be a php, asp, etc. script which, in turn, can access any page/read write any files (on the server) that it wants to. Haven't seen anything on the web about this, so I thought I'd post it! All this may be common knowledge to you Java programmers (I'm still learnin'!), but it's definitely valuable knowledge for me... sorry for bein a noob

Thanks to whoever read this!
</edit>