org.jets3t.apps.uploader
Class UploaderFileExtensionFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by org.jets3t.apps.uploader.UploaderFileExtensionFilter

public class UploaderFileExtensionFilter
extends javax.swing.filechooser.FileFilter

Defines which files can be selected within the Uploader's file chooser for upload to S3. Files are filtered based on their filename extension.

Author:
James Murty

Constructor Summary
UploaderFileExtensionFilter(java.lang.String description, java.util.List fileExtensionsList)
          Construct an extension-based file filter
 
Method Summary
 boolean accept(java.io.File file)
           
 java.lang.String getDescription()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploaderFileExtensionFilter

public UploaderFileExtensionFilter(java.lang.String description,
                                   java.util.List fileExtensionsList)
Construct an extension-based file filter

Parameters:
description - the name for this filter, such as "Movie files"
fileExtensionsList - a list of file extensions that the filter will accept, eg "avi", "mpg".
Method Detail

accept

public boolean accept(java.io.File file)
Specified by:
accept in class javax.swing.filechooser.FileFilter
Returns:
True if the file is a Directory, or the file has an extension that matches one of the allowed extensions provided to this class's constructor. False otherwise.

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in class javax.swing.filechooser.FileFilter