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


Java SelectorUtils.rtrimWildcardTokens方法代码示例

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


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

示例1: checkIncludePatterns

import org.apache.tools.ant.types.selectors.SelectorUtils; //导入方法依赖的package包/类
/**
 * this routine is actually checking all the include patterns in
 * order to avoid scanning everything under base dir
 * @since ant1.6
 */
private void checkIncludePatterns() {

    Map<String, String> newroots = new Hashtable<>();
    // put in the newroots vector the include patterns without
    // wildcard tokens
    for (int icounter = 0; icounter < includes.length; icounter++) {
        String newpattern =
            SelectorUtils.rtrimWildcardTokens(includes[icounter]);
        newroots.put(newpattern, includes[icounter]);
    }
    if (task.getRemotedir() == null) {
        try {
            task.setRemotedir(ftp.printWorkingDirectory());
        } catch (IOException e) {
            throw new BuildException("could not read current ftp directory",
                                     task.getLocation());
        }
    }
    AntFTPFile baseFTPFile = new AntFTPRootFile(ftp, task.getRemotedir());
    rootPath = baseFTPFile.getAbsolutePath();
    // construct it
    if (newroots.containsKey("")) {
        // we are going to scan everything anyway
        scandir(rootPath, "", true);
    } else {
        // only scan directories that can include matched files or
        // directories
        newroots.forEach(
            (k, v) -> scanRoot(new AntFTPFile(baseFTPFile, k), v));
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:37,代码来源:FTPTaskMirrorImpl.java

示例2: checkIncludePatterns

import org.apache.tools.ant.types.selectors.SelectorUtils; //导入方法依赖的package包/类
/**
 * this routine is actually checking all the include patterns in
 * order to avoid scanning everything under base dir
 * @since ant1.6
 */
private void checkIncludePatterns() {

    Map<String, String> newroots = new HashMap<>();
    // put in the newroots vector the include patterns without
    // wildcard tokens
    for (int icounter = 0; icounter < includes.length; icounter++) {
        String newpattern =
            SelectorUtils.rtrimWildcardTokens(includes[icounter]);
        newroots.put(newpattern, includes[icounter]);
    }
    if (remotedir == null) {
        try {
            remotedir = ftp.printWorkingDirectory();
        } catch (IOException e) {
            throw new BuildException("could not read current ftp directory",
                                     getLocation());
        }
    }
    AntFTPFile baseFTPFile = new AntFTPRootFile(ftp, remotedir);
    rootPath = baseFTPFile.getAbsolutePath();
    // construct it
    if (newroots.containsKey("")) {
        // we are going to scan everything anyway
        scandir(rootPath, "", true);
    } else {
        // only scan directories that can include matched files or
        // directories
        newroots.forEach((k, v) -> scanRoots(baseFTPFile, k, v));
    }
}
 
开发者ID:apache,项目名称:ant,代码行数:36,代码来源:FTP.java


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