Frank,

We may both be correct but I wrote a product that made extensive use of the
JNDI file system context. We had trouble with file URL's. To discover the
correct syntax I wrote a simple program to output the URL from a
java.io.File. When we ran the following code it produced the output that I
described on a Windows system.

/*
 * fileURLTest.java
 *
 */

/**
 *
 * @author  [EMAIL PROTECTED]
 */
public class fileURLTest
{

        /** Creates a new instance of fileURLTest */
        public fileURLTest()
        {
        }

        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) throws Exception
        {
                java.io.File oFile;

                // Create an arbitrary file path with drive specifier
                oFile = new java.io.File("C:\\PathTest\\test.txt");
                System.out.println("URL with Drive Specifier:");
                System.out.println("File: " + oFile.getPath() + " File URL: " +
oFile.toURL());

                }

}


-----Original Message-----
From: ftg [mailto:ftg]On Behalf Of Frank Griffin
Sent: Monday, March 18, 2002 12:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Connecting to stateless Session EJB, Lookup error.


James McCarthy wrote:

>
> With Drive Specifier:
>
> file:/C:/RestOfPath/file.name
>
> Without Drive Specifier:
>
> file:///RestOfPath/file.name

file:///  is correct.  With URLs, the high-level is some sort of network
identifier, the next is the host, followed by the absolute path on the
filesystem.

     http://host/directory/file.ext
says to use nothing for the network ID (that's the absence of anything
between the
two slashes).

     file:///C:/blabla
says to use nothing for the network ID *and* nothing for the hostname (which
isn't
needed for a local file).

Reply via email to