} else { try { baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir()); } catch (MalformedURLException ex) { throw new BuildException("Project basedir cannot be converted to a URL");
} else { try { baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir()); } catch (MalformedURLException ex) { throw new BuildException("Project basedir cannot be converted to a URL");
/** * Utility method to lookup a ResourceLocation in the classpath. * * @return An InputSource for reading the resource, or <code>null</code> * if the resource does not exist in the classpath or is not readable. */ private InputSource classpathLookup(ResourceLocation matchingEntry) { InputSource source = null; Path cp = classpath; if (cp != null) { cp = classpath.concatSystemClasspath("ignore"); } else { cp = (new Path(getProject())).concatSystemClasspath("last"); } AntClassLoader loader = getProject().createClassLoader(cp); // // for classpath lookup we ignore the base directory // InputStream is = loader.getResourceAsStream(matchingEntry.getLocation()); if (is != null) { source = new InputSource(is); URL entryURL = loader.getResource(matchingEntry.getLocation()); String sysid = entryURL.toExternalForm(); source.setSystemId(sysid); log("catalog entry matched a resource in the classpath: '" + sysid + "'", Project.MSG_DEBUG); } return source; }
loader = getProject().createClassLoader(Path.systemClasspath);
/** * Allows nested classpath elements. Not allowed if this catalog * is itself a reference to another catalog -- that is, a catalog * cannot both refer to another <em>and</em> contain elements or * other attributes. * * @return a Path instance to be configured. */ public Path createClasspath() { if (isReference()) { throw noChildrenAllowed(); } if (this.classpath == null) { this.classpath = new Path(getProject()); } setChecked(false); return this.classpath.createPath(); }
/** Creates a nested <code><catalogpath></code> element. * Not allowed if this catalog is itself a reference to another * catalog -- that is, a catalog cannot both refer to another * <em>and</em> contain elements or other attributes. * * @return a path to be configured as the catalog path. * @exception BuildException * if this is a reference and no nested elements are allowed. */ public Path createCatalogPath() { if (isReference()) { throw noChildrenAllowed(); } if (this.catalogPath == null) { this.catalogPath = new Path(getProject()); } setChecked(false); return this.catalogPath.createPath(); }
try { if (base == null) { baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir()); } else { baseURL = new URL(base);
base = FILE_UTILS.getFileURL(getProject().getBaseDir()).toString(); } catch (MalformedURLException x) { throw new TransformerException(x);