Browse Source

Use URLProvider instead of URLResource

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@830209 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
28ca062311
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java

+ 7
- 5
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -28,7 +28,7 @@ import org.apache.tools.ant.TargetGroup;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.UnknownElement;
import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.resources.URLResource;
import org.apache.tools.ant.types.resources.URLProvider;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.JAXPUtils;
import org.xml.sax.Attributes;
@@ -94,16 +94,18 @@ public class ProjectHelper2 extends ProjectHelper {
* content as something that can be turned into an Antlib task.
*
* <p>simply delegates to {@link #parseUnknownElement
* parseUnknownElement}.</p>
* parseUnknownElement} if the resource provides an URL and throws
* an exceptipn otherwise.</p>
*
* @since ant 1.8.0
* @since Ant 1.8.0
*/
public UnknownElement parseAntlibDescriptor(Project containingProject,
Resource resource) {
if (!(resource instanceof URLResource)) {
URLProvider up = (URLProvider) resource.as(URLProvider.class);
if (up == null) {
throw new BuildException("Unsupported resource type: " + resource);
}
return parseUnknownElement(containingProject, ((URLResource)resource).getURL());
return parseUnknownElement(containingProject, up.getURL());
}

/**


Loading…
Cancel
Save