当前位置: 首页>>代码示例>>Java>>正文


Java FileSelector类代码示例

本文整理汇总了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));
	}

}
 
开发者ID:fastconnect,项目名称:tibco-fcunit,代码行数:24,代码来源:PrepareTestMojo.java

示例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;
}
 
开发者ID:apache,项目名称:ant,代码行数:19,代码来源:Sync.java

示例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;
}
 
开发者ID:apache,项目名称:ant,代码行数:14,代码来源:Files.java

示例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()]);
}
 
开发者ID:apache,项目名称:ant,代码行数:14,代码来源:AbstractFileSet.java

示例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);
}
 
开发者ID:apache,项目名称:ant,代码行数:14,代码来源:AbstractFileSet.java

示例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);
}
 
开发者ID:apache,项目名称:ant,代码行数:15,代码来源:AbstractFileSet.java

示例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);
}
 
开发者ID:apache,项目名称:ant,代码行数:19,代码来源:IsFileSelected.java

示例8: selectorElements

import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public Enumeration<FileSelector> selectorElements() {
    return selectors.selectorElements();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:PathFileSet.java

示例9: getSelectors

import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public FileSelector[] getSelectors(Project p) {
    return selectors.getSelectors(p);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:PathFileSet.java

示例10: appendSelector

import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public void appendSelector(FileSelector selector) {
    selectors.appendSelector(selector);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:PathFileSet.java

示例11: add

import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
public void add(FileSelector selector) {
    selectors.add(selector);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:PathFileSet.java

示例12: add

import org.apache.tools.ant.types.selectors.FileSelector; //导入依赖的package包/类
@Override public void add(FileSelector selector) {
  usedMatchingTask = true;
  super.add(selector);
}
 
开发者ID:spurious,项目名称:kawa-mirror,代码行数:5,代码来源:Kawac.java

示例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;
}
 
开发者ID:subclipse,项目名称:svnant,代码行数:9,代码来源:SvnDirScanner.java

示例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;
}
 
开发者ID:apache,项目名称:ant,代码行数:10,代码来源:DirectoryScanner.java

示例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);
}
 
开发者ID:apache,项目名称:ant,代码行数:10,代码来源:AbstractFileSet.java


注:本文中的org.apache.tools.ant.types.selectors.FileSelector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。