Re: Absolute path in Manifest Class-Path header?
- From: Lee Fesperman <firstsql@xxxxxxxxxxxxx>
- Date: Mon, 23 May 2005 19:45:14 GMT
John C. Bollinger wrote:
>
> Lee Fesperman wrote:
>
> > John C. Bollinger wrote:
> >
> >>bo_kid@xxxxxxxxx wrote:
> >>
> >>
> >>>Thanks for your mail Vitaly Shelest.
> >>>
> >>>/c:/ext.jar
> >>>works and seems to have the same effect as
> >>>file:///c:/ext.jar
> >>>
> >>>I'm really curious about this. Where can one find information about
> >>>this? Did you just use try and error or is this /c:/... documented
> >>>somewhere?
> >>
> >>I STRONGLY suspect that this is an implementation quirk, not a supported
> >>behavior. The string you describe is not a well-formed pathname on
> >>Windows, and I have never seen mention of this behavior among the
> >>specifications and docs. I can, however, imagine implementation code
> >>that happened to make this work by accident. If my characterization is
> >>correct, then it is not safe to assume that this will continue to work
> >>in future versions of the Java tools.
> >
> >
> > Check the javadocs for java.net.URL. The leading slash (/) is used to
> > prevent "c:" being parsed as a protocol specification. If the default
> > protocol is set to "file:" (a reasonable assumption in this case), such
> > a string would be parsed as an 'absolute' file path. This is just a guess
> > on my part, but it does fit. We use this 'trick' in our software; it does
> > work ... with some odd variations between JDK versions ;^)
>
> Ah. So you're saying that "/c:/ext.jar" is interpreted as a URL instead
> of as an absolute path? It still sounds like there is more undocumented
> behavior involved than I would be comfortable relying upon. If it is
> meant to be a URL, then putting "file://" in front of it removes all
> ambiguity for small cost. Do you happen to know whether the same
> variations between JDK versions also affected that form?
The docs do say that URLs are being used. What they don't seem to mention is the default
protocol is "file:". In our software, we are explicit about this in the docs.
As to variations, I did a quick check on 1.1, 1.2, 1.3 and 1.4 using java.net.URL. The
differences are quite complex, but, in general, the parsing becomes more liberal about
'relative' paths in later versions. For instance, JDK 1.1 apparently doesn't allow
relative paths at all. 1.1 seems to assume they are all absolute. After 1.1, earlier
versions allow relative paths with "drive:" specifications if it is the current drive.
By 1.4, any drive can referenced. As far as I checked, "file://" must be absolute and
the slash is required after "drive:", but "file:/d:" can be relative. Rather messy ;^)
--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
==============================================================
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
.
- Follow-Ups:
- Re: Absolute path in Manifest Class-Path header?
- From: bo_kid
- Re: Absolute path in Manifest Class-Path header?
- References:
- Absolute path in Manifest Class-Path header?
- From: bo_kid
- Re: Absolute path in Manifest Class-Path header?
- From: Roland
- Re: Absolute path in Manifest Class-Path header?
- From: bo_kid
- Re: Absolute path in Manifest Class-Path header?
- From: bo_kid
- Re: Absolute path in Manifest Class-Path header?
- From: John C. Bollinger
- Re: Absolute path in Manifest Class-Path header?
- From: Lee Fesperman
- Re: Absolute path in Manifest Class-Path header?
- From: John C. Bollinger
- Absolute path in Manifest Class-Path header?
- Prev by Date: Re: inputstream length?
- Next by Date: Re: public attributes, wrong?
- Previous by thread: Re: Absolute path in Manifest Class-Path header?
- Next by thread: Re: Absolute path in Manifest Class-Path header?
- Index(es):
Relevant Pages
|