View Javadoc

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   * Filters for *.lst files in JFileChooser.  
11   * <p>
12   * Copyright (c) 1999-2007 Melloware, Inc. <http://www.melloware.com>
13   * @author Emil A. Lefkof III <info@melloware.com>
14   * @version 4.0
15   * AZ Development 2009
16   */
17  public final class lstFilter extends FileFilter {
18      
19      public final static String lst = "lst";
20      public final static String[] EXTENSIONS = new String[] {lst};
21      
22      /**
23       * Default Constuctor
24       */
25      public lstFilter() {
26          super();
27      }
28  
29      /**
30       * Accept all files such as .lst.
31       * <p>
32       * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
33       */
34      public boolean accept(final File aFile) {
35          if (aFile.isDirectory()) {
36              return true;
37          }
38          
39          return FilenameUtils.isExtension(aFile.getName().toLowerCase(),EXTENSIONS);
40      }
41  
42      /* (non-Javadoc)
43       * @see javax.swing.filechooser.FileFilter#getDescription()
44       */
45      public String getDescription() {
46          return "disclist Files (*.lst)";
47      }
48      
49      
50  
51  }