szheli
June 1st, 2000, 02:54 PM
I am writing an appliet which retrieves the lastModidfied time of an image file located on the same location as the applet. I created a File object with the URL to the file, and tried to call a member method such as lastModified(), I get an exception. If I test it on my local machine, it works, if I run it over the network on a web server, the exception occurs. here is the code, I appreciate any comments.
String path = "http://webs1/nr/assembly/childcarecam/ChildCareImages/ccc1.jpg";
File image_file = new File(path);
showStatus(path);
boolean exist = image_file.exists();//exception
showStatus("file time retrieved");
long creation_time = image_file.lastModified();
String path = "http://webs1/nr/assembly/childcarecam/ChildCareImages/ccc1.jpg";
File image_file = new File(path);
showStatus(path);
boolean exist = image_file.exists();//exception
showStatus("file time retrieved");
long creation_time = image_file.lastModified();