Getting Server Path

I would like to load the file list of a folder in the server and show the file list in the java applet.

privatevoid LoadFileList(){

String userDir = System.getProperty("user.dir");

jLabel1.setText(userDir);

File folder =new File(userDir);

File[] listOfFiles = folder.listFiles();

Vector data =new Vector();

data.add("etete");

for (int i = 0; i < listOfFiles.length; i++){

if (listOfFiles[i].isFile()){

data.add(listOfFiles[i].getName());

//System.out.println("File " + listOfFiles[i].getName());

}elseif (listOfFiles[i].isDirectory()){

//System.out.println("Directory " + listOfFiles[i].getName());

}

}

fileList =new JList(data);

}

The currect setting will be set at desktop folder (i dont know why it produces such result). I would like to know what userDir should set so as to load the directory in the server rather than the directory in my developing desktop.

Thank you.

[1657 byte] By [MISa] at [2007-11-27 4:45:25]
# 1
Applets run in the client and have no direct access to the server file system.
sabre150a at 2007-7-12 9:57:47 > top of Java-index,Java Essentials,Java Programming...
# 2
then what shall i do in order to access the server file path?Thank you
MISa at 2007-7-12 9:57:47 > top of Java-index,Java Essentials,Java Programming...
# 3
> then what shall i do in order to access the server> file path?> Much depends on the detail what you are trying to allow the users of your Applet to do. As a minimum you will need to write/obtain a simple file server application that runs on the server.
sabre150a at 2007-7-12 9:57:47 > top of Java-index,Java Essentials,Java Programming...
# 4
actually i just want to load all the images file in particular folder from the server.. the user will be able to delete it or add new images...it will be quite a problem to me if i need to write a file server...is there any other alternative?Thank you
MISa at 2007-7-12 9:57:47 > top of Java-index,Java Essentials,Java Programming...
# 5
If you using a Servlet engine you can do all that using Servlets.
sabre150a at 2007-7-12 9:57:47 > top of Java-index,Java Essentials,Java Programming...
# 6

> actually i just want to load all the images file in

> particular folder from the server.. the user will be

> able to delete it or add new images...it will be

> quite a problem to me if i need to write a file

> server...is there any other alternative?

>

buy one...

jwentinga at 2007-7-12 9:57:47 > top of Java-index,Java Essentials,Java Programming...
# 7
is it possible if i use the applet to call the php to peform the functions and send back the code to the client applet?Thx
MISa at 2007-7-12 9:57:47 > top of Java-index,Java Essentials,Java Programming...