The following JSP code snippet gets list of directories.

Java Code:
<h1>Directories</h1>
<ul>
<%
String root="c:/Repository/WebApplication/mydocs/javadoc/";
java.io.File file;
java.io.File dir = new java.io.File(root);

String[] list = dir.list();

if (list.length > 0) {

for (int i = 0; i < list.length; i++) {
  file = new java.io.File(root + list[i]);
  if (file.isDirectory()) {
  %>
  <li><a href="javadoc/<%=list[i]%>" target="_top"><%=list[i]%></a><br>
  <%
     }
  }
}
%>
</ul>