For Programmers: Free Programming Magazines  


Home > Archive > Java Help > January 2008 > List available files in web directory?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author List available files in web directory?
pxl

2008-01-21, 7:36 pm

Hello,

How can I obtain a list of all the files available from a directory on
my server after connecting with an HttpUrlConnection.

Ex.
Connect to http://example.net/test/

Retrieve al ist of all files available in http://example.net/test/.


Thanks.
Nigel Wade

2008-01-21, 7:36 pm

pxl wrote:

> Hello,
>
> How can I obtain a list of all the files available from a directory on
> my server after connecting with an HttpUrlConnection.
>
> Ex.
> Connect to http://example.net/test/
>
> Retrieve al ist of all files available in http://example.net/test/.
>
>


This is not a function of Java, it's a function of the HTTP server which serves
the URL in question.

You might be able to configure the HTTP server so that it returns directory
listings. How you do that will depend on your HTTP server. apache uses the
mod_dir and mod_autoindex modules for this. See apache docs. for more details
at http://httpd.apache.org/docs/. I have no idea how other HTTP servers manage
this.

Also, be aware that without adequate knowledge and precautions this is a huge
security hole as it may allow anyone to navigate and download the entire
contents of your web server.


--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com