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


Java FileFilterUtils.andFileFilter方法代码示例

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


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

示例1: makeDirectoryAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of directories.
 * 
 * @param filter The filter to make aware of directories.
 * @param directoryName The directory name which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makeDirectoryAware( IOFileFilter filter, String directoryName )
{

    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.directoryFileFilter(),
                                                                      FileFilterUtils.nameFileFilter( directoryName ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:17,代码来源:FileFilterHelper.java

示例2: makeFileNameAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of files.
 * 
 * @param filter The filter to make aware of files.
 * @param fileName The file name which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makeFileNameAware( IOFileFilter filter, String fileName )
{
    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.fileFileFilter(),
                                                                      FileFilterUtils.nameFileFilter( fileName ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:16,代码来源:FileFilterHelper.java

示例3: makeSuffixAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of an suffix.
 * 
 * @param filter The filter to make aware of an suffix.
 * @param suffixFileName The suffix name which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makeSuffixAware( IOFileFilter filter, String suffixFileName )
{
    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.fileFileFilter(),
                                                                      FileFilterUtils.suffixFileFilter( suffixFileName ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:16,代码来源:FileFilterHelper.java

示例4: makePatternFileNameAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of the given pattern.
 * 
 * @param filter The filter to make aware of the pattern.
 * @param pattern The pattern which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makePatternFileNameAware( IOFileFilter filter, String pattern )
{
    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.fileFileFilter(),
                                                                      new RegexFileFilter( pattern ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:16,代码来源:FileFilterHelper.java

示例5: makeDirectoryAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of directories.
 *
 * @param filter The filter to make aware of directories.
 * @param directoryName The directory name which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makeDirectoryAware( IOFileFilter filter, String directoryName )
{

    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.directoryFileFilter(),
                                                                      FileFilterUtils.nameFileFilter( directoryName ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:mojohaus,项目名称:appassembler,代码行数:17,代码来源:FileFilterHelper.java

示例6: makeFileNameAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of files.
 *
 * @param filter The filter to make aware of files.
 * @param fileName The file name which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makeFileNameAware( IOFileFilter filter, String fileName )
{
    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.fileFileFilter(),
                                                                      FileFilterUtils.nameFileFilter( fileName ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:mojohaus,项目名称:appassembler,代码行数:16,代码来源:FileFilterHelper.java

示例7: makeSuffixAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of an suffix.
 *
 * @param filter The filter to make aware of an suffix.
 * @param suffixFileName The suffix name which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makeSuffixAware( IOFileFilter filter, String suffixFileName )
{
    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.fileFileFilter(),
                                                                      FileFilterUtils.suffixFileFilter( suffixFileName ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:mojohaus,项目名称:appassembler,代码行数:16,代码来源:FileFilterHelper.java

示例8: makePatternFileNameAware

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Make the given IOFileFilter aware of the given pattern.
 *
 * @param filter The filter to make aware of the pattern.
 * @param pattern The pattern which should be payed attention to.
 * @return The new generated filter.
 */
public static IOFileFilter makePatternFileNameAware( IOFileFilter filter, String pattern )
{
    IOFileFilter directoryAwareFilter =
        FileFilterUtils.notFileFilter( FileFilterUtils.andFileFilter( FileFilterUtils.fileFileFilter(),
                                                                      new RegexFileFilter( pattern ) ) );

    return FileFilterUtils.andFileFilter( filter, directoryAwareFilter );
}
 
开发者ID:mojohaus,项目名称:appassembler,代码行数:16,代码来源:FileFilterHelper.java

示例9: 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

示例10: retrieveFilesToAggregate

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
protected List<File> retrieveFilesToAggregate() {
    File inputDirectory = new File(inputFilePath);
    if (!inputDirectory.exists() || !inputDirectory.isDirectory()) {
        throw new RuntimeException(inputFilePath + " does not exist or is not a directory.");
    }
    FileFilter filter = FileFilterUtils.andFileFilter(
            new PrefixFileFilter(inputFilePrefix), new SuffixFileFilter(inputFileSuffix));
    
    List<File> fileList = Arrays.asList(inputDirectory.listFiles(filter));
    
    Collections.sort(fileList);
    
    return fileList;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:15,代码来源:ReportAggregationStep.java

示例11: getReportsToAggregateIntoReport

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
protected List<File> getReportsToAggregateIntoReport(String documentNumber) {
    File inputDirectory = new File(temporaryReportsDirectory);
    if (!inputDirectory.exists() || !inputDirectory.isDirectory()) {
        LOG.error(temporaryReportsDirectory + " does not exist or is not a directory.");
        throw new RuntimeException("Unable to locate temporary reports directory");
    }
    String filePrefix = documentNumber + "_" + temporaryReportFilenameComponent;
    FileFilter filter = FileFilterUtils.andFileFilter(
            new PrefixFileFilter(filePrefix), new SuffixFileFilter(temporaryReportFilenameSuffix));
    
    // FSKD-244, KFSMI-5424 sort with filename, just in case 
    List<File> fileList = Arrays.asList(inputDirectory.listFiles(filter));
    
    Comparator fileNameComparator = new Comparator() {
        public int compare(Object obj1, Object obj2) {
            if (obj1 == null) {
                return -1;
            }
            if (obj2 == null) {
                return 1;
            }
            File file1 = (File) obj1;
            File file2 = (File) obj2;
            
            return ((Comparable) file1.getName()).compareTo(file2.getName());
        }
    };
    
    Collections.sort(fileList, fileNameComparator);
    return fileList ;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:32,代码来源:CorrectionDocumentServiceImpl.java

示例12: listFiles

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * <p>Finds files within a given directory (and optionally its 
 * subdirectories). All files found are filtered by an IOFileFilter.
 * </p>
 * <p>If your search should recurse into subdirectories you can pass in 
 * an IOFileFilter for directories. You don't need to bind a 
 * DirectoryFileFilter (via logical AND) to this filter. This method does 
 * that for you.
 * </p>
 * <p>An example: If you want to search through all directories called
 * "temp" you pass in <code>FileFilterUtils.NameFileFilter("temp")</code>
 * </p>
 * <p>Another common usage of this method is find files in a directory
 * tree but ignoring the directories generated CVS. You can simply pass
 * in <code>FileFilterUtils.makeCVSAware(null)</code>.
 * </p>  
 * @param directory the directory to search in
 * @param fileFilter filter to apply when finding files.
 * @param dirFilter optional filter to apply when finding subdirectories. 
 * If this parameter is null, subdirectories will not be included in the
 * search. Use TrueFileFilter.INSTANCE to match all directories.
 * @return an collection of java.io.File with the matching files
 * @see org.apache.commons.io.filefilter.FileFilterUtils
 * @see org.apache.commons.io.filefilter.NameFileFilter
 */
public static Collection listFiles(File directory, IOFileFilter fileFilter, IOFileFilter dirFilter) {
    if (!directory.isDirectory()) {
        throw new IllegalArgumentException("Parameter 'directory' is not a directory");
    }
    if (fileFilter == null) {
        throw new NullPointerException("Parameter 'fileFilter' is null");
    }
    
    //Setup effective file filter
    IOFileFilter effFileFilter = FileFilterUtils.andFileFilter(fileFilter, 
        FileFilterUtils.notFileFilter(DirectoryFileFilter.INSTANCE));
        
    //Setup effective directory filter
    IOFileFilter effDirFilter;
    if (dirFilter == null) {
        effDirFilter = FalseFileFilter.INSTANCE;
    } else {
        effDirFilter = FileFilterUtils.andFileFilter(dirFilter,
            DirectoryFileFilter.INSTANCE);
    }
    
    //Find files
    Collection files = new java.util.LinkedList();
    innerListFiles(files, directory, 
        FileFilterUtils.orFileFilter(effFileFilter, effDirFilter));
    return files;
}
 
开发者ID:rektide,项目名称:javamaildir,代码行数:53,代码来源:FileUtils.java

示例13: getDirectoryFilter

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Font directory filter.  Currently ignores hidden directories.
 * @return IOFileFilter font directory filter
 */
protected static IOFileFilter getDirectoryFilter() {
    return FileFilterUtils.andFileFilter(
            FileFilterUtils.directoryFileFilter(),
            FileFilterUtils.notFileFilter(FileFilterUtils.prefixFileFilter("."))
    );
}
 
开发者ID:pellcorp,项目名称:fop,代码行数:11,代码来源:FontFileFinder.java

示例14: getFileFilter

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Font file filter.  Currently searches for files with .ttf, .ttc, .otf, and .pfb extensions.
 * @return IOFileFilter font file filter
 */
protected static IOFileFilter getFileFilter() {
    return FileFilterUtils.andFileFilter(
            FileFilterUtils.fileFileFilter(),
            new WildcardFileFilter(
                    new String[] {"*.ttf", "*.otf", "*.pfb", "*.ttc"},
                    IOCase.INSENSITIVE)
    );
}
 
开发者ID:pellcorp,项目名称:fop,代码行数:13,代码来源:FontFileFinder.java


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