com.resilientedge.util.io
Class SimpleFileFilter

java.lang.Object
  |
  +--javax.swing.filechooser.FileFilter
        |
        +--com.resilientedge.util.io.SimpleFileFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class SimpleFileFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FilenameFilter

Class that implements the java.io.FilenameFilter interface. TODO: Add support for adding an extension and description pair to properly implement the swing.filechooser.FileFilter for JFileChooser.

Version:
$Revision: 1.1.1.1 $
Author:
Mike Jennings

Constructor Summary
SimpleFileFilter(java.lang.String ext)
          Constructor for SimpleFileFilter
SimpleFileFilter(java.lang.String[] exts)
          Constructor for SimpleFileFilter
 
Method Summary
 boolean accept(java.io.File file)
          filefilter interface method
 boolean accept(java.io.File dir, java.lang.String _name)
          filenamefilter interface method
static java.lang.String[] fileOrFiles(java.io.File f)
          this method checks to see if an asterisk is imbedded in the filename, if it is, it does an "ls" or "dir" of the parent directory returning a list of files that match eg.
 java.lang.String getDescription()
          Gets the Description attribute of the SimpleFileFilter object
 java.lang.String[] getExtensions()
          Gets the Extensions attribute of the SimpleFileFilter object
 void setDescription(java.lang.String description)
          Sets the Description attribute of the SimpleFileFilter object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFileFilter

public SimpleFileFilter(java.lang.String ext)
Constructor for SimpleFileFilter
Parameters:
ext - Parameter Description

SimpleFileFilter

public SimpleFileFilter(java.lang.String[] exts)
Constructor for SimpleFileFilter
Parameters:
exts - Parameter Description
Method Detail

setDescription

public void setDescription(java.lang.String description)
Sets the Description attribute of the SimpleFileFilter object
Parameters:
description - The new Description value

getExtensions

public java.lang.String[] getExtensions()
Gets the Extensions attribute of the SimpleFileFilter object
Returns:
The Extensions value

getDescription

public java.lang.String getDescription()
Gets the Description attribute of the SimpleFileFilter object
Overrides:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
The Description value

accept

public boolean accept(java.io.File dir,
                      java.lang.String _name)
filenamefilter interface method
Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - Parameter Description
_name - Parameter Description
Returns:
Returned Value Description

accept

public boolean accept(java.io.File file)
filefilter interface method
Overrides:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - Description of Parameter
Returns:
Returned Value Description

fileOrFiles

public static java.lang.String[] fileOrFiles(java.io.File f)
this method checks to see if an asterisk is imbedded in the filename, if it is, it does an "ls" or "dir" of the parent directory returning a list of files that match eg. /usr/home/mjennings/*.jar would expand out to all of the files with a .jar extension in the /usr/home/mjennings directory
Parameters:
f - Parameter Description
Returns:
Returned Value Description


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.