本文整理汇总了Java中org.apache.tools.ant.types.Resource.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.toString方法的具体用法?Java Resource.toString怎么用?Java Resource.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tools.ant.types.Resource
的用法示例。
在下文中一共展示了Resource.toString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSelected
import org.apache.tools.ant.types.Resource; //导入方法依赖的package包/类
/**
* Return true if this Resource is selected.
* @param r the Resource to check.
* @return whether the Resource was selected.
*/
public boolean isSelected(Resource r) {
String n = r.getName();
if (matches(n)) {
return true;
}
String s = r.toString();
return s.equals(n) ? false : matches(s);
}
示例2: eval
import org.apache.tools.ant.types.Resource; //导入方法依赖的package包/类
/**
* Verify that all resources match.
* @return true if all resources are equal.
* @exception BuildException if there is an error.
*/
@Override
public boolean eval() throws BuildException {
if (resources == null) {
throw new BuildException(
"You must specify one or more nested resource collections");
}
if (resources.size() > 1) {
Iterator<Resource> i = resources.iterator();
Resource r1 = i.next();
Resource r2;
while (i.hasNext()) {
r2 = i.next();
try {
if (!ResourceUtils.contentEquals(r1, r2, asText)) {
return false;
}
} catch (IOException ioe) {
throw new BuildException("when comparing resources "
+ r1.toString() + " and " + r2.toString(), ioe);
}
r1 = r2;
}
}
return true;
}