com.sun.jini.system
Class JavaSourceFilter

java.lang.Object
  extended by com.sun.jini.system.JavaSourceFilter
All Implemented Interfaces:
FileFilter

public class JavaSourceFilter
extends Object
implements FileFilter

Implementation of FilenameFilter to allow us to just look for java files by default, or other file extensions if the user wishes to use a different extension.

Author:
Sun Microsystems, Inc.

Field Summary
private  String fileExtension
          The extension that we we want to look for.
 
Constructor Summary
JavaSourceFilter()
          Create a filter for *.java files.
JavaSourceFilter(String fileExtension)
          Create a filter for a user defined extension.
 
Method Summary
 boolean accept(File filename)
          Method required by FilenameFilter interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileExtension

private String fileExtension
The extension that we we want to look for.

Constructor Detail

JavaSourceFilter

public JavaSourceFilter()
Create a filter for *.java files.


JavaSourceFilter

public JavaSourceFilter(String fileExtension)
Create a filter for a user defined extension. If an empty string is passed then all files will be matched.

Parameters:
fileExtension - The extension the user is looking for.
Method Detail

accept

public boolean accept(File filename)
Method required by FilenameFilter interface. It is called by File.list() to get a subset of the files in the given directory.

Specified by:
accept in interface FileFilter
Parameters:
filename - The current file we are looking at.


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.