Applet File Detection

Say I use this code an an Applet

publicboolean fileExists(file){

File f =new File(file);

return f.exists();

}

Does that check for the file on the client computer or the server computer?

[409 byte] By [SidewinderXa] at [2007-11-27 11:21:35]
# 1

Client.

You are aware of the security restrictions on an applet regarding files?

cotton.ma at 2007-7-29 14:49:38 > top of Java-index,Java Essentials,Java Programming...
# 2

> Client.

>

> You are aware of the security restrictions on an

> applet regarding files?

Actually I'm not. But it would be pretty dumb not to have them considering if there were none, an applet could delete all files on your hard drive.

I don't want to delete, write or append any files. I just need to check to see if it exists. Are there restrictions on this?

Thanks

SidewinderXa at 2007-7-29 14:49:38 > top of Java-index,Java Essentials,Java Programming...
# 3

> > Client.

> >

> > You are aware of the security restrictions on an

> > applet regarding files?

>

> Actually I'm not. But it would be pretty dumb not to

> have them considering if there were none, an applet

> could delete all files on your hard drive.

>

> I don't want to delete, write or append any files. I

> just need to check to see if it exists. Are there

> restrictions on this?

>

> Thanks

Yes, there are restrictions on this. You will need to sign your applet in order to access the file system (whether for reading or writing).

Navy_Codera at 2007-7-29 14:49:38 > top of Java-index,Java Essentials,Java Programming...
# 4

See http://java.sun.com/sfaq/

cotton.ma at 2007-7-29 14:49:38 > top of Java-index,Java Essentials,Java Programming...