org.netbeans.lib.cvsclient.util
Class DefaultIgnoreFileFilter

java.lang.Object
  extended by org.netbeans.lib.cvsclient.util.DefaultIgnoreFileFilter
All Implemented Interfaces:
IgnoreFileFilter

public class DefaultIgnoreFileFilter
extends java.lang.Object
implements IgnoreFileFilter


Constructor Summary
DefaultIgnoreFileFilter()
           
DefaultIgnoreFileFilter(java.util.List patternList)
          Creates new DefaultIgnoreFileFilter and fills in patterns.
 
Method Summary
 void addPattern(java.lang.String pattern)
          Adds a string to the list of ignore file patters using the SimpleStringPattern.
 void addPattern(StringPattern pattern)
          Adds a StringPattern to the list of ignore file patters.
 void clearPatterns()
          Clears the list of patters.
static java.util.List parseCvsIgnoreFile(java.io.File cvsIgnoreFile)
          Utility method that reads the .cvsignore file and returns a list of Strings.
 boolean shouldBeIgnored(java.io.File directory, java.lang.String noneCvsFile)
          A file is checked against the patterns in the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIgnoreFileFilter

public DefaultIgnoreFileFilter()

DefaultIgnoreFileFilter

public DefaultIgnoreFileFilter(java.util.List patternList)
Creates new DefaultIgnoreFileFilter and fills in patterns.

Parameters:
patternList - - list of objects, patterns are retrieved via the Object.toString() method.
Method Detail

addPattern

public void addPattern(StringPattern pattern)
Adds a StringPattern to the list of ignore file patters.


addPattern

public void addPattern(java.lang.String pattern)
Adds a string to the list of ignore file patters using the SimpleStringPattern.


clearPatterns

public void clearPatterns()
Clears the list of patters. To be used when the "!" character is used in any of the .cvsignore lists.


shouldBeIgnored

public boolean shouldBeIgnored(java.io.File directory,
                               java.lang.String noneCvsFile)
A file is checked against the patterns in the filter. If any of these matches, the file should be ignored. A file will also be ignored, if its name matches any local .cvsignore file entry.

Specified by:
shouldBeIgnored in interface IgnoreFileFilter
Parameters:
directory - is a file object that refers to the directory the file resides in.
noneCvsFile - is the name of the file to be checked.

parseCvsIgnoreFile

public static java.util.List parseCvsIgnoreFile(java.io.File cvsIgnoreFile)
                                         throws java.io.IOException,
                                                java.io.FileNotFoundException
Utility method that reads the .cvsignore file and returns a list of Strings. These strings represent the patterns read from the file.

Throws:
java.io.IOException
java.io.FileNotFoundException

 

Built on October 26 2010.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.