ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <>
Subject Re: Refactor of PathTokenizer - am I missing something?
Date Fri, 04 Jan 2002 01:06:34 GMT
Hi Jeff,

I think I now have a better understanding of the problem ...

Jeff Tulley wrote:
> Bill,
>     One thing that you are missing here is the fact that it is not a
> build file directly that is triggering this problem, at least not in the
> sense of the <path>, <classpath>,  and <pathelement> tags.  What is
> actually giving me grief is a <javadoc> task that uses PathTokenizer.

Okay, I didn't realize <javadoc> was the culprit.

>     It seems that I should support UNIX path names, since our OS has a
> file mode that would allow you to reference our volumes in a UNIX-like
> manner.  (instead of sys:/temp, it would be /sys/temp, if I am not
> mistaken).

Okay, I didn't realize you could specify a NetWare volume with /vol/path
syntax.  I'm assuming that's exposed to the JVM?

Here's another take at the problem.  Both ";" and ":" are supported
depending on whether a ";" is found anywhere in the path but not both
together.  Of course, the one limitation is the assumption that a filename
or directory can't contain a ";":

    public PathTokenizer(String path) {
        String tokens = ":;";
        // When running under NetWare, look for a ";" anywhere in the
path.  If not
        // found, assume a UNIX style path and use ":", otherwise use ";"
as the
        // delimiter.
        if ( null != path && Os.isFamily("netware") ) {
            tokens = ( path.indexOf(';') == -1 ) ? ":" : ";";
        tokenizer = new StringTokenizer(path, tokens, false);
        dosStyleFilesystem = File.pathSeparatorChar == ';';

All of the following paths should be tokenized properly:

Hope this helps,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message