It depends what you are trying to do....
1) If you are trying to develop a client application which connects to a web server you would need to configure the web server to provide directory listings. Generally this is disabled as it is a security risk.
2) If you are trying to develop a server application which provides directory listing, you need to write an simple application which uses java.io.ServerSocket and creates a
Thread for each connection which would get the directory listing a pass the list back as an html
string.
Jason.