There's no way to get a directory listing unless code on the remote machine wants to give you one. Some web servers are configured to give directory listings of certain directories; that would just be an HTML page containing the list of files, and you'd access it using the HttpURLConnection class.
Another possibility is a
ftp:// URL. An ftp server will generally be happy to give you directory listings, if you issue the appropriate command. For these, your best best is a third-party FTP library. There's one in Apache's Jakarta Commons, I believe.