URL url = ... construct a URL Now how do I get the parent? You can parse the path manually, but a URL can be a jar resource, HTTP address, file location, newsgroup, partial url, etc.
http://archive.ncsa.uiuc.edu/SDG/Software/Mosaic/Demo/url-primer.html Rather than parsing the path, it's easier and more explicit to simply declare the root. Also, this is more powerful since you can do relative imports from the root. Solving two problems at once. Now the build writer decides how build files are resolved. They can be relative to the orginal build file as described above or relative to another root. <urlimport urlroot="http://mybuildserver.com/builds/" file="root-build.xml "/> <urlimport urlroot="http://mybuildserver.com" file="builds/root-build.xml"/> So... root-build.xml can be written to resolve files relative to itself: <project> <import file="compile.xml"/> </project> ... or relative to a root. <project> <import file="builds/compile.xml"/> </project> This concept works for directories, jars, etc. Mike On 11/29/05, Dominique Devienne <[EMAIL PROTECTED]> wrote: > > > A URL has no concept of a 'parent'. > > I beg to disagree. If it didn't, the web wouldn't work ;-) > > Here's the proof, in this URL contructor: URL(URL context, String spec). > --DD > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >