Package org.apache.ivy.util.url
Class ApacheURLLister
java.lang.Object
org.apache.ivy.util.url.ApacheURLLister
Utility class which helps to list urls under a given url. This has been tested with Apache 1.3.33
server listing, as the one used at ibiblio, and with Apache 2.0.53 server listing, as the one on
mirrors.sunsite.dk.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of sub urls of the given url.listDirectories
(URL url) Returns a list of sub 'directories' of the given url.Returns a list of sub 'files' (in opposition to directories) of the given url.retrieveListing
(URL url, boolean includeFiles, boolean includeDirectories)
-
Constructor Details
-
ApacheURLLister
public ApacheURLLister()
-
-
Method Details
-
listAll
Returns a list of sub urls of the given url. The returned list is a list of URL.- Parameters:
url
- The base URL from which to retrieve the listing.- Returns:
- a list of sub urls of the given url.
- Throws:
IOException
- If an error occurs retrieving the HTML.
-
listDirectories
Returns a list of sub 'directories' of the given url. The returned list is a list of URL.- Parameters:
url
- The base URL from which to retrieve the listing.- Returns:
- a list of sub 'directories' of the given url.
- Throws:
IOException
- If an error occurs retrieving the HTML.
-
listFiles
Returns a list of sub 'files' (in opposition to directories) of the given url. The returned list is a list of URL.- Parameters:
url
- The base URL from which to retrieve the listing.- Returns:
- a list of sub 'files' of the given url.
- Throws:
IOException
- If an error occurs retrieving the HTML.
-
retrieveListing
public List<URL> retrieveListing(URL url, boolean includeFiles, boolean includeDirectories) throws IOException Retrieves aList
ofURL
s corresponding to the files and/or directories found at the supplied base URL.- Parameters:
url
- The base URL from which to retrieve the listing.includeFiles
- If true include files in the returned list.includeDirectories
- If true include directories in the returned list.- Returns:
- A
List
ofURL
s. - Throws:
IOException
- If an error occurs retrieving the HTML.
-