From my Servlet or JSP, I'd like to be able to get a list of all the files and/or directories in a directory using the HTTP directory listing feature.
- my JSP is on: http://www.mycompany.com/getlist.jsp
- the directory I want to list the contents of is at: http://www.othercompany.com/files/
The resulting output I'd like from my JSP should be something like:
Hello, there are 2 files and 1 directories in the /files/ directory!
The files are:
- bigfile.zip is 350 MB and was last modified on 15 March 2005 at 11:38:29
- smallpdf.pdf is 24 KB and was last modified on 2 April 2004 at 09:23:14
The directories are:
Is there any clever/built-in way of doing this with Java, aside from creating a function that parses the HTML returned from the web server's HTTP directory listing?