FileDocCategorySizeDatePackage
GetURLs.javaAPI DocExample1236Mon Jul 03 20:15:50 BST 2000None

GetURLs

public class GetURLs extends Object

Fields Summary
ReadTag
reader
The tag reader
public static final String[]
wantTags
Constructors Summary
public GetURLs(URL theURL)

		reader = new ReadTag(theURL);
	
public GetURLs(String theURL)

		reader = new ReadTag(theURL);
	
Methods Summary
public voidclose()

		if (reader != null) 
			reader.close();
	
public java.util.ArrayListgetURLs()


	     
		ArrayList al = new ArrayList();
		String tag;
		while ((tag = reader.nextTag()) != null) {
			for (int i=0; i<wantTags.length; i++) {
				if (tag.startsWith(wantTags[i])) {
					al.add(tag);
					continue;		// optimization
				}
			}
		}
		return al;
	
public static voidmain(java.lang.String[] argv)

		String theURL = argv.length == 0 ?
			"http://localhost/" : argv[0];
		GetURLs gu = new GetURLs(theURL);
		ArrayList urls = gu.getURLs();
		Iterator urlIterator = urls.iterator();
		while (urlIterator.hasNext()) {
			System.out.println(urlIterator.next());
		}