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