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


Java FileFilterUtils.fileFileFilter方法代码示例

本文整理汇总了Java中org.apache.commons.io.filefilter.FileFilterUtils.fileFileFilter方法的典型用法代码示例。如果您正苦于以下问题:Java FileFilterUtils.fileFileFilter方法的具体用法?Java FileFilterUtils.fileFileFilter怎么用?Java FileFilterUtils.fileFileFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.io.filefilter.FileFilterUtils的用法示例。


在下文中一共展示了FileFilterUtils.fileFileFilter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fileFilter

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
private IOFileFilter fileFilter() {
    IOFileFilter fileFileFilter = FileFilterUtils.fileFileFilter();
    IOFileFilter[] noes = new IOFileFilter[]{
        new RegexFileFilter(B + X + D + "class" + E),
        new RegexFileFilter(B + X + D + "db" + E),
        new RegexFileFilter(B + X + D + "ear" + E),
        new RegexFileFilter(B + X + D + "err" + E),
        new RegexFileFilter(B + X + D + "gif" + E),
        new RegexFileFilter(B + X + D + "jar" + E),
        new RegexFileFilter(B + X + D + "jpg" + E),
        new RegexFileFilter(B + X + D + "lnk" + E),
        new RegexFileFilter(B + X + D + "log" + E),
        new RegexFileFilter(B + X + D + "nbm" + E),
        new RegexFileFilter(B + X + D + "out" + E),
        new RegexFileFilter(B + X + D + "png" + E),
        new RegexFileFilter(B + X + D + "war" + E),
        new RegexFileFilter(B + X + D + "zip" + E)
    };
    IOFileFilter noesFileFilter = FileFilterUtils.notFileFilter(FileFilterUtils.or(noes));
    IOFileFilter filter = FileFilterUtils.and(fileFileFilter, noesFileFilter);
    return filter;
}
 
开发者ID:proyecto-adalid,项目名称:adalid,代码行数:23,代码来源:FileBrowser.java

示例2: listFiles

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Recurse in the folder to get the list all files and folders
 * <ul>
 * <li>do not recurse in svn folder</li>
 * <li>do not recurse in cvs folder</li>
 * <li>do not match .bak files</li>
 * <li>do not match .old files</li>
 * </ul>
 *
 * @param folder       the folder to parse
 * @param ioFileFilter additionnal IOFilter
 */
@SuppressWarnings("unchecked")
public Collection<String> listFiles(File folder, IOFileFilter ioFileFilter) {
    if (ioFileFilter == null) {
        ioFileFilter = FileFilterUtils.fileFileFilter();
    }
    OrFileFilter oldFilesFilter = new OrFileFilter();
    for (String exclude : DEFAULT_EXCLUDES_SUFFIXES) {
        oldFilesFilter.addFileFilter(FileFilterUtils.suffixFileFilter(exclude));
    }
    IOFileFilter notOldFilesFilter = FileFilterUtils.notFileFilter(oldFilesFilter);

    Collection<File> files = FileUtils.listFiles(folder, FileFilterUtils.andFileFilter(ioFileFilter, notOldFilesFilter),
            FileFilterUtils.makeSVNAware(FileFilterUtils.makeCVSAware(null)));
    Collection<String> ret = newArrayList();
    for (File file : files) {
        ret.add(file.getAbsolutePath());
    }
    return ret;
}
 
开发者ID:jaxio,项目名称:celerio,代码行数:32,代码来源:IOUtil.java

示例3: getSearchResults

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
@Override
public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues) {
    List<BatchFile> results = new ArrayList<BatchFile>();

    IOFileFilter filter = FileFilterUtils.fileFileFilter();
    
    IOFileFilter pathBasedFilter = getPathBasedFileFilter();
    if (pathBasedFilter != null) {
        filter = FileFilterUtils.andFileFilter(filter, pathBasedFilter);
    }
    
    String fileNamePattern = fieldValues.get("fileName");
    IOFileFilter fileNameBasedFilter = getFileNameBasedFilter(fileNamePattern);
    if (fileNameBasedFilter != null) {
        filter = FileFilterUtils.andFileFilter(filter, fileNameBasedFilter);
    }
    
    String lastModifiedDate = fieldValues.get("lastModifiedDate");
    IOFileFilter lastModifiedDateBasedFilter = getLastModifiedDateBasedFilter(lastModifiedDate);
    if (lastModifiedDateBasedFilter != null) {
        filter = FileFilterUtils.andFileFilter(filter, lastModifiedDateBasedFilter);
    }
    
    BatchFileFinder finder = new BatchFileFinder(results, filter);
    List<File> rootDirectories = BatchFileUtils.retrieveBatchFileLookupRootDirectories();
    finder.find(rootDirectories);
    
    return results;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:30,代码来源:BatchFileLookupableHelperServiceImpl.java

示例4: defaultFileFilter

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
protected IOFileFilter defaultFileFilter() {
    //  This was the default, being removed to widen the scope,
    //  since extension-based dispatch is implemented at the Build level
    //  anyway, to call the right Rhino-based compilers.
    //  return FileUtil.fileFilterForExtensions(this.getAssetExtensions());
    return FileFilterUtils.fileFileFilter();
}
 
开发者ID:semperos,项目名称:screwdriver,代码行数:8,代码来源:AssetSpec.java

示例5: countFiles

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
private Integer countFiles(File path){
	int total = 0;
	FileFilter filesOnly = FileFilterUtils.fileFileFilter();
	FileFilter dirsOnly = FileFilterUtils.directoryFileFilter();
	File[] files = path.listFiles(filesOnly);
	System.out.println(files);
	total += files.length;
	for (File file : path.listFiles(dirsOnly)){
		total += countFiles(file);
	}
	return total;
}
 
开发者ID:jbake-org,项目名称:jbake,代码行数:13,代码来源:AssetTest.java


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