so Im working on viewing files within A JSP page. However, any folders within a directory only appear as '.DS_Store' Rather than showing all folders with their correct names. I nhave used this code from this thread: How to list contents of a server directory using JSP?
The code:
<table class="main" id="tableMain">
<thead>
<th scope="col">First</th>
<%@page import="java.io.*" %> 
<%@page import="java.util.*" %> 
<%!        public void GetDirectory(String a_Path, Vector a_files, Vector a_folders) {
            File l_Directory = new File(a_Path);
            File[] l_files = l_Directory.listFiles();
            for (int c = 0; c < l_files.length; c++) {
                if (l_files[c].isDirectory()) {
                    a_folders.add(l_files[c].getName());
                } else {
                    a_files.add(l_files[c].getName());
                }
            }
        }
    %> 
    <%
        Vector l_Files = new Vector(), l_Folders = new Vector();
        GetDirectory("/Library/Tomcat/webapps/HelloServlet/uploads", l_Files, l_Folders);
        for (int a = 0; a < l_Files.size(); a++) {
            out.println("<tr>");
            out.println("<td>" + l_Files.elementAt(a).toString() + "</td>");
            out.println("</tr>");
        }
    %> 
Any help would be appreciated, thanks!
 
    