本文整理汇总了Java中org.apache.tools.ant.types.selectors.FileSelector类的典型用法代码示例。如果您正苦于以下问题:Java FileSelector类的具体用法?Java FileSelector怎么用?Java FileSelector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FileSelector类属于org.apache.tools.ant.types.selectors包,在下文中一共展示了FileSelector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeFileContaining
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
private void removeFileContaining(String content) {
DirectoryScanner ds = new DirectoryScanner();
String[] includes = {"**/*.process"};
ds.setIncludes(includes);
ds.setBasedir(testSrcDirectory);
//ds.setCaseSensitive(true);
ContainsSelector contentToRemove = new ContainsSelector();
contentToRemove.setText(content);
FileSelector[] selectors = {contentToRemove};
ds.setSelectors(selectors);
ds.scan();
String[] files = ds.getIncludedFiles();
for (int i = 0; i < files.length; i++) {
String file = testSrcDirectory + File.separator + files[i];
getLog().debug("Deleting file with starter : '" + file + "'");
getLog().info("Deleting file with starter : '" + file + "'");
FileUtils.deleteQuietly(new File(file));
}
}
示例2: toFileSet
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
private FileSet toFileSet(boolean withPatterns) {
FileSet fs = new FileSet();
fs.setCaseSensitive(isCaseSensitive());
fs.setFollowSymlinks(isFollowSymlinks());
fs.setMaxLevelsOfSymlinks(getMaxLevelsOfSymlinks());
fs.setProject(getProject());
if (withPatterns) {
PatternSet ps = mergePatterns(getProject());
fs.appendIncludes(ps.getIncludePatterns(getProject()));
fs.appendExcludes(ps.getExcludePatterns(getProject()));
for (FileSelector sel : getSelectors(getProject())) {
fs.appendSelector(sel);
}
fs.setDefaultexcludes(getDefaultexcludes());
}
return fs;
}
示例3: appendSelector
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Add a new selector into this container.
*
* @param selector the new <code>FileSelector</code> to add.
*/
@Override
public synchronized void appendSelector(FileSelector selector) {
if (isReference()) {
throw noChildrenAllowed();
}
super.appendSelector(selector);
ds = null;
}
示例4: getSelectors
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Returns the set of selectors as an array.
* @param p the current project
* @return a <code>FileSelector[]</code> of the selectors in this container.
*/
@Override
public synchronized FileSelector[] getSelectors(Project p) {
if (isReference()) {
return getRef(getProject()).getSelectors(p);
}
dieOnCircularReference(p);
return selectors.toArray(new FileSelector[selectors.size()]);
}
示例5: selectorElements
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Returns an enumerator for accessing the set of selectors.
*
* @return an <code>Enumeration</code> of selectors.
*/
@Override
public synchronized Enumeration<FileSelector> selectorElements() {
if (isReference()) {
return getRef(getProject()).selectorElements();
}
dieOnCircularReference();
return Collections.enumeration(selectors);
}
示例6: appendSelector
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Add a new selector into this container.
*
* @param selector the new <code>FileSelector</code> to add.
*/
@Override
public synchronized void appendSelector(FileSelector selector) {
if (isReference()) {
throw noChildrenAllowed();
}
selectors.add(selector);
directoryScanner = null;
setChecked(false);
}
示例7: eval
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Evaluate the selector with the file.
* @return true if the file is selected by the embedded selector.
*/
public boolean eval() {
if (file == null) {
throw new BuildException("file attribute not set");
}
validate();
File myBaseDir = baseDir;
if (myBaseDir == null) {
myBaseDir = getProject().getBaseDir();
}
FileSelector f = getSelectors(getProject())[0];
return f.isSelected(
myBaseDir, FILE_UTILS.removeLeadingPath(myBaseDir, file), file);
}
示例8: selectorElements
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public Enumeration<FileSelector> selectorElements() {
return selectors.selectorElements();
}
示例9: getSelectors
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public FileSelector[] getSelectors(Project p) {
return selectors.getSelectors(p);
}
示例10: appendSelector
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public void appendSelector(FileSelector selector) {
selectors.appendSelector(selector);
}
示例11: add
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public void add(FileSelector selector) {
selectors.add(selector);
}
示例12: add
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
@Override public void add(FileSelector selector) {
usedMatchingTask = true;
super.add(selector);
}
示例13: setSelectors
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Sets the selectors that will select the filelist.
*
* @param selectors specifies the selectors to be invoked on a scan
*/
public void setSelectors( FileSelector[] selectors ) {
this.selectors = selectors;
}
示例14: setSelectors
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Set the selectors that will select the filelist.
*
* @param selectors specifies the selectors to be invoked on a scan.
*/
@Override
public synchronized void setSelectors(final FileSelector[] selectors) {
this.selectors = selectors;
}
示例15: add
import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
/**
* Add an arbitrary selector.
* @param selector the <code>FileSelector</code> to add.
* @since Ant 1.6
*/
@Override
public void add(FileSelector selector) {
appendSelector(selector);
}