|
What this is
Other links
The source code/*
* Sun Public License Notice
*
* The contents of this file are subject to the Sun Public License
* Version 1.0 (the "License"). You may not use this file except in
* compliance with the License. A copy of the License is available at
* http://www.sun.com/
*
* The Original Code is NetBeans. The Initial Developer of the Original
* Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
* Microsystems, Inc. All Rights Reserved.
*/
package org.netbeans.lib.cvsclient.util;
import java.io.*;
import java.util.*;
/**
* @author Milos Kleint, Thomas Singer
*/
public class DefaultIgnoreFileFilter implements IgnoreFileFilter {
private final List patterns = new LinkedList();
private final List localPatterns = new LinkedList();
private boolean processGlobalPatterns = true;
private boolean processLocalPatterns = false;
private File lastDirectory = null;
public DefaultIgnoreFileFilter() {
}
/**
* Creates new DefaultIgnoreFileFilter and fills in patterns.
* @param patternList - list of objects, patterns are retrieved
* via the Object.toString() method.
*/
public DefaultIgnoreFileFilter(List patternList) {
for (Iterator it = patternList.iterator(); it.hasNext();) {
String patternString = it.next().toString();
SimpleStringPattern pattern = new SimpleStringPattern(patternString);
addPattern(pattern);
}
}
/**
* Adds a StringPattern to the list of ignore file patters.
*/
public void addPattern(StringPattern pattern) {
if (pattern.toString().equals("!")) { //NOI18N
clearPatterns();
}
else {
patterns.add(pattern);
}
}
/**
* Adds a string to the list of ignore file patters using the SimpleStringPattern.
*/
public void addPattern(String pattern) {
if (pattern.equals("!")) { //NOI18N
clearPatterns();
}
else {
patterns.add(new SimpleStringPattern(pattern));
}
}
/**
* Clears the list of patters.
* To be used when the "!" character is used in any of the .cvsignore lists.
*/
public void clearPatterns() {
patterns.clear();
}
/**
* 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
|
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.