2
* Copyright (C) 2001-2012 Michael Fuchs
4
* This file is part of herold.
6
* herold is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
11
* herold is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with herold. If not, see <http://www.gnu.org/licenses/>.
19
package org.dbdoclet.io;
22
import java.io.FilenameFilter;
25
* Die Klasse <code>EndsWithFilter</code> überprüft ob der Name einer
26
* Datei mit dem definierten Anfang übereinstimmt.
28
* @author <a href="mailto:michael.fuchs@unico-group.com">Michael Fuchs</a>
31
public class StartsWithFilter
32
implements FilenameFilter {
34
/** Der Anfang, der überprüft werden soll. */
38
* Erzeugt eine neue Instanz der Klasse
39
* <code>StartsWithFileNameFilter</code>.
41
* @param start <code>String</code>
43
public StartsWithFilter(String start) {
48
* Die Methode <code>accept</code> überprüft ob der angegebene Dateiname auf
49
* den definierten Anfang passt.
51
* Die Überprüfung des Anfangs erfolgt ohne Beachtung der Groß- und
54
* @param file <code>File</code>
55
* @param name <code>String</code>
56
* @return <code>boolean</code>
58
public boolean accept(File file, String name) {
60
String s1 = name.toLowerCase();
61
String s2 = start.toLowerCase();
63
return s1.startsWith(s2);
67
* $Log: StartsWithFileNameFilter.java,v $
68
* Revision 1.1.1.1 2004/12/21 14:06:38 mfuchs
71
* Revision 1.3 2004/09/03 08:26:54 mfuchs
74
* Revision 1.2 2004/08/27 19:30:32 mfuchs
77
* Revision 1.1.1.1 2004/05/13 17:14:37 mfuchs