01: /*
02: * Enhydra Java Application Server Project
03: *
04: * The contents of this file are subject to the Enhydra Public License
05: * Version 1.1 (the "License"); you may not use this file except in
06: * compliance with the License. You may obtain a copy of the License on
07: * the Enhydra web site ( http://www.enhydra.org/ ).
08: *
09: * Software distributed under the License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11: * the License for the specific terms governing rights and limitations
12: * under the License.
13: *
14: * The Initial Developer of the Enhydra Application Server is Lutris
15: * Technologies, Inc. The Enhydra Application Server and portions created
16: * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17: * All Rights Reserved.
18: *
19: * Contributor(s):
20: *
21: */
22:
23: package org.enhydra.kelp.common.importer;
24:
25: // Kelp imports
26: import org.enhydra.kelp.common.Constants;
27:
28: // Standard imports
29: import java.io.FileFilter;
30: import java.io.File;
31:
32: public class MakefileFilter implements FileFilter {
33:
34: /**
35: * Creates an extension file filter without an extensions set.
36: */
37: public MakefileFilter() {
38: }
39:
40: /**
41: * Return true if this file should be shown in a file chooser.
42: */
43: public boolean accept(File f) {
44: boolean acceptFile = false;
45: if (f == null) {
46: acceptFile = true;
47: } else if (f.isDirectory()) {
48: acceptFile = true;
49: } else {
50: String lowPath = f.getAbsolutePath().toLowerCase();
51: acceptFile = lowPath.endsWith(File.separator
52: + Constants.FILE_MAKEFILE)
53: || lowPath.endsWith(File.separator
54: + Constants.FILE_CONFIG_MK);
55:
56: }
57: return acceptFile;
58: }
59:
60: }
|