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


Java FileFilterUtils.makeFileOnly方法代码示例

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


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

示例1: handleJavaStyleComments

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
public static void handleJavaStyleComments( String baseDir ) throws Exception {
    IOFileFilter sourceFileFilter = FileFilterUtils.orFileFilter(
            FileFilterUtils.suffixFileFilter("java"),
            FileFilterUtils.suffixFileFilter("js") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("css") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("groovy") );
    sourceFileFilter = FileFilterUtils.makeSVNAware(sourceFileFilter);
    sourceFileFilter = FileFilterUtils.makeFileOnly(sourceFileFilter);

    LicensableFileDirectoryWalker dw = new LicensableFileDirectoryWalker(sourceFileFilter, "/*", " * ", " */");
    Collection<String> results = dw.run( baseDir );
    System.out.println( results );
}
 
开发者ID:kuali,项目名称:kfs,代码行数:18,代码来源:LicenseHeaderUpdate.java

示例2: handleXMLStyleComments

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
public static void handleXMLStyleComments( String baseDir ) throws Exception {
    IOFileFilter sourceFileFilter = FileFilterUtils.orFileFilter(
            FileFilterUtils.suffixFileFilter("xml"),
            FileFilterUtils.suffixFileFilter("jrxml") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("html") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("htm") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("xsd") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("tld") );
    sourceFileFilter = FileFilterUtils.makeSVNAware(sourceFileFilter);
    sourceFileFilter = FileFilterUtils.makeFileOnly(sourceFileFilter);

    LicensableFileDirectoryWalker dw = new LicensableFileDirectoryWalker(sourceFileFilter, "<!--", "   - ", " -->");
    Collection<String> results = dw.run( baseDir );
    System.out.println( results );
}
 
开发者ID:kuali,项目名称:kfs,代码行数:24,代码来源:LicenseHeaderUpdate.java

示例3: handleJSPStyleComments

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
public static void handleJSPStyleComments( String baseDir ) throws Exception {
    IOFileFilter sourceFileFilter = FileFilterUtils.orFileFilter(
            FileFilterUtils.suffixFileFilter("jsp"),
            FileFilterUtils.suffixFileFilter("tag") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("inc") );
    sourceFileFilter = FileFilterUtils.makeSVNAware(sourceFileFilter);
    sourceFileFilter = FileFilterUtils.makeFileOnly(sourceFileFilter);

    LicensableFileDirectoryWalker dw = new LicensableFileDirectoryWalker(sourceFileFilter, "<%--", "   - ", "--%>");
    Collection<String> results = dw.run( baseDir );
    System.out.println( results );
}
 
开发者ID:kuali,项目名称:kfs,代码行数:15,代码来源:LicenseHeaderUpdate.java

示例4: handlePropertyStyleComments

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
public static void handlePropertyStyleComments( String baseDir ) throws Exception {
    IOFileFilter sourceFileFilter = FileFilterUtils.orFileFilter(
            FileFilterUtils.suffixFileFilter("properties"),
            FileFilterUtils.suffixFileFilter("cmd") );
    sourceFileFilter = FileFilterUtils.orFileFilter(
            sourceFileFilter,
            FileFilterUtils.suffixFileFilter("sh") );
    sourceFileFilter = FileFilterUtils.makeSVNAware(sourceFileFilter);
    sourceFileFilter = FileFilterUtils.makeFileOnly(sourceFileFilter);

    LicensableFileDirectoryWalker dw = new LicensableFileDirectoryWalker(sourceFileFilter, "########################################", "# ", "########################################");
    Collection<String> results = dw.run( baseDir );
    System.out.println( results );
}
 
开发者ID:kuali,项目名称:kfs,代码行数:15,代码来源:LicenseHeaderUpdate.java

示例5: handleSQLStyleComments

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
public static void handleSQLStyleComments( String baseDir ) throws Exception {
    IOFileFilter sourceFileFilter = FileFilterUtils.suffixFileFilter("sql");
    sourceFileFilter = FileFilterUtils.makeSVNAware(sourceFileFilter);
    sourceFileFilter = FileFilterUtils.makeFileOnly(sourceFileFilter);

    LicensableFileDirectoryWalker dw = new LicensableFileDirectoryWalker(sourceFileFilter, "--", "-- ", LINE_SEPARATOR);
    Collection<String> results = dw.run( baseDir );
    System.out.println( results );
}
 
开发者ID:kuali,项目名称:kfs,代码行数:10,代码来源:LicenseHeaderUpdate.java

示例6: DirectoryWalker

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Construct an instance with a directory and a file filter and an optional
 * limit on the <i>depth</i> navigated to.
 * <p>
 * The filters control which files and directories will be navigated to as part
 * of the walk. This constructor uses {@link FileFilterUtils#makeDirectoryOnly(IOFileFilter)}
 * and {@link FileFilterUtils#makeFileOnly(IOFileFilter)} internally to combine the filters.
 * A <code>null</code> filter means that no filtering should occur.
 *
 * @param directoryFilter  the filter to apply to directories, null means visit all directories
 * @param fileFilter  the filter to apply to files, null means visit all files
 * @param depthLimit  controls how <i>deep</i> the hierarchy is
 *  navigated to (less than 0 means unlimited)
 */
protected DirectoryWalker(IOFileFilter directoryFilter, IOFileFilter fileFilter, int depthLimit) {
    if (directoryFilter == null && fileFilter == null) {
        this.filter = null;
    } else {
        directoryFilter = (directoryFilter != null ? directoryFilter : TrueFileFilter.TRUE);
        fileFilter = (fileFilter != null ? fileFilter : TrueFileFilter.TRUE);
        directoryFilter = FileFilterUtils.makeDirectoryOnly(directoryFilter);
        fileFilter = FileFilterUtils.makeFileOnly(fileFilter);
        this.filter = FileFilterUtils.or(directoryFilter, fileFilter);
    }
    this.depthLimit = depthLimit;
}
 
开发者ID:fesch,项目名称:Moenagade,代码行数:27,代码来源:DirectoryWalker.java

示例7: DirectoryWalker

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Construct an instance with a directory and a file filter and an optional
 * limit on the <i>depth</i> navigated to.
 * <p>
 * The filters control which files and directories will be navigated to as part
 * of the walk. This constructor uses {@link FileFilterUtils#makeDirectoryOnly(IOFileFilter)}
 * and {@link FileFilterUtils#makeFileOnly(IOFileFilter)} internally to combine the filters.
 * A {@code null} filter means that no filtering should occur.
 *
 * @param directoryFilter  the filter to apply to directories, null means visit all directories
 * @param fileFilter  the filter to apply to files, null means visit all files
 * @param depthLimit  controls how <i>deep</i> the hierarchy is
 *  navigated to (less than 0 means unlimited)
 */
protected DirectoryWalker(IOFileFilter directoryFilter, IOFileFilter fileFilter, int depthLimit) {
    if (directoryFilter == null && fileFilter == null) {
        this.filter = null;
    } else {
        directoryFilter = directoryFilter != null ? directoryFilter : TrueFileFilter.TRUE;
        fileFilter = fileFilter != null ? fileFilter : TrueFileFilter.TRUE;
        directoryFilter = FileFilterUtils.makeDirectoryOnly(directoryFilter);
        fileFilter = FileFilterUtils.makeFileOnly(fileFilter);
        this.filter = FileFilterUtils.or(directoryFilter, fileFilter);
    }
    this.depthLimit = depthLimit;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:DirectoryWalker.java

示例8: DirectoryWalker

import org.apache.commons.io.filefilter.FileFilterUtils; //导入方法依赖的package包/类
/**
 * Construct an instance with a directory and a file filter and an optional
 * limit on the <i>depth</i> navigated to.
 * <p>
 * The filters control which files and directories will be navigated to as part
 * of the walk. This constructor uses {@link FileFilterUtils#makeDirectoryOnly(IOFileFilter)}
 * and {@link FileFilterUtils#makeFileOnly(IOFileFilter)} internally to combine the filters.
 * A {@code null} filter means that no filtering should occur.
 *
 * @param directoryFilter  the filter to apply to directories, null means visit all directories
 * @param fileFilter  the filter to apply to files, null means visit all files
 * @param depthLimit  controls how <i>deep</i> the hierarchy is
 *  navigated to (less than 0 means unlimited)
 */
protected DirectoryWalker(IOFileFilter directoryFilter, IOFileFilter fileFilter, final int depthLimit) {
    if (directoryFilter == null && fileFilter == null) {
        this.filter = null;
    } else {
        directoryFilter = directoryFilter != null ? directoryFilter : TrueFileFilter.TRUE;
        fileFilter = fileFilter != null ? fileFilter : TrueFileFilter.TRUE;
        directoryFilter = FileFilterUtils.makeDirectoryOnly(directoryFilter);
        fileFilter = FileFilterUtils.makeFileOnly(fileFilter);
        this.filter = FileFilterUtils.or(directoryFilter, fileFilter);
    }
    this.depthLimit = depthLimit;
}
 
开发者ID:PuppyRush,项目名称:WidgetStore,代码行数:27,代码来源:DirectoryWalker.java


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