Skip to main content
summaryrefslogtreecommitdiffstats
blob: 782a1a501bf147f38c377d971c7b64d4ed81f041 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.eclipse.help.internal.util;

/*
 * Licensed Materials - Property of IBM,
 * WebSphere Studio Workbench
 * (c) Copyright IBM Corp 2000
 */

import java.io.FilenameFilter;

/**
 * Filters out filenames, accepting only
 * htm, html, txt, xml extensions.
 */
public class SearchableDocFileNameFilter implements FilenameFilter {
	/**
	 * Constructs SearchableDocFileNameFilter
	 */
	public SearchableDocFileNameFilter() {
		super();
	}
	/**
	 * accepts filenames of the htm, html, txt, xml extensions.
	 * @param dirName not used, required by interface
	 * @parama fileName file name
	 * @returns true if file name has been accepted
	 */
	public boolean accept(java.io.File dirName, String fileName) {
		fileName = fileName.toLowerCase();
		if (fileName.endsWith(".htm")
			|| fileName.endsWith(".html")
			|| fileName.endsWith(".txt")
			|| fileName.endsWith(".xml")) {
			return true;
		}
		return false;
	}
}

Back to the top