Applet and random access files
Excuse me for my bad english as I'm french: I 've got an applet which uses several text files.
When I run the program from a server(or a distant computer), how can I have a random access to the text files using URL ?
Otherwise is there another way to read this files ?
How can I go trough the Java security ??
Thank you
you can mail me at roger.simeon@ifrance.com
[393 byte] By [
TimmZ] at [2007-11-15 20:13:08]

# 1 Re: Applet and random access files
TimmZ,
Excuse my English... for I am an American. :).
Are the text files located on the Server side?
If so, there are alot of security problems to consider at the Server side.
Are you in the position to rewrite the server as to have it send you the files instead of having the Applet trying to access them itself?
Regards,
dogBear
# 2 Re: Applet and random access files
We can't download the files because they are too much big (severals Mo).
How can we do, in order to reach them on the server-side ?
Thanks for your help
TimmZ
TimmZ at 2007-11-10 2:54:37 >

# 3 Re: Applet and random access files
hai TimmZ,
There would't be any problem when u ar reading the data from the file.
Hope the following code will help u.
try
{
URL url=new URL(getCodeBase(),"temp.txt");
URLConnection con=url.openConnection();
InputStream in=con.getInputStream();
DataInputStream result=new DataInputStream(in);
String text = (String)result.readUTF();
}
catch(Exception e)
{System.out.println("e"+e);}
if any problem mail me
bye
-bharath
S.V Bharath Reddy
Software Engineer,
Hyderabad.
# 4 Re: Applet and random access files
TimmyZ,
Thanks for the rating...
But I haven't done much to help you yet!
This seems like a complicated problem.
From what I know, if the text file you want
the applet to read is several Mb's in size,
you must devise a system to give the
Applet the information it needs. Perhaps
the server can be rewritten to read the text
file, compress it, and then send it to the
Applet. OR perhaps the server can read the
text file and send only the information the
Applet requires.
There are many ways to solve this problem.
Perhaps if you give us more details we can
better help.
Regards,
dogBear
# 5 Re: Applet and random access files
Hi,
I have a requirement quite similar to the one you had mentioned. My requirement is that i have files (excel,doc,pdf) on the server, i need to show these files on the clients machine (without downloading) and changes made by user should be saved back to server.
If anyone can help me out in this, wil be of great help.
Thanks a lot.
Meenu