1 package com.melloware.jukes.file.filter;
2
3 import java.io.File;
4
5 import javax.swing.filechooser.FileFilter;
6
7 import org.apache.commons.io.FilenameUtils;
8
9
10
11
12
13
14
15
16 public final class CsvFilter
17 extends FileFilter {
18
19 public static final String CSV = "csv";
20 public static final String[] EXTENSIONS = new String[] { CSV };
21
22
23
24
25 public CsvFilter() {
26 super();
27 }
28
29
30
31
32 public String getDescription() {
33 return "Comma Separated Values (*.csv)";
34 }
35
36
37
38
39
40
41 public boolean accept(File aFile) {
42 if (aFile.isDirectory()) {
43 return true;
44 }
45
46 return FilenameUtils.isExtension(aFile.getName().toLowerCase(), EXTENSIONS);
47 }
48
49 }