list files/directories in JSP page

Hi. How can i list all files in a specified folder? I need to list all files from some directory and create a select element with retrived filenames. What class i need to use?.Thanks.
[197 byte] By [max_ukra] at [2007-10-3 2:17:41]
# 1
Hi,Use File class of java.iouse the list method of that class to get all information about that directory which includes files and subdirctories.Reg,Mike
mohan_ksamya at 2007-7-14 19:16:31 > top of Java-index,Java Essentials,New To Java...
# 2

File directory = new File(url);

if(directory.isDirectory()) {

File[] files = directory.listFiles();

}

Then, in your JSP page, you take the file list (with a JavaBean for example) and with a for loop you create a SELECT BOX.

<%

for(int i=0; i<filelist.size(); i++) {

%>

<OPTION>filelist.get(i).getName()</OPTION>

<%

}

%>

UBERTI84a at 2007-7-14 19:16:31 > top of Java-index,Java Essentials,New To Java...