Hello,

 

Wonne, James

Thank you (dank u ;) for the help, but it does not solve the problem completely.

 

I did some debugging and indeed with file:////server/path/xmlfile.xml it doesn't try to do an ftp, but my filename gets changed to

/server/path/xmlfile.xml

The // that I need to indicate a network path in windows is lost


hans


"James Strachan" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
21/01/2003 14:11 GMT

To: "Keysers, Wonne" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc:
bcc:
Subject: Re: [dom4j-user] Cannot read file on windows server


Agreed. The read method can take a File, a URL, or a String url as well as an InputStream or Reader - though the first 3 are preferred as it gives the default EntityResolver implementation a chance..

James
-------
http://radio.weblogs.com/0112098/
----- Original Message -----
From: Keysers, Wonne
To: '[EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 11:14 AM
Subject: RE: [dom4j-user] Cannot read file on windows server

Hi (Dag :-) Hans,

I believe this should work:
reader.read( new URL("file:////server/path/file.xml") );

Wonne

-----Original Message-----
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: 1/21/2003 11:26 AM
Subject: [dom4j-user] Cannot read file on windows server

Hello,

I want to access open an xml file located on a distant server
\\server\path\myxml.xml".
If I try to open the file with the java File class, all goes perfectly
well.
If I try to execute following code I get a connection error:

        f = new File(_fileName);
        if (!f.exists()) {
            throw new error
        }
        reader = new SAXReader();
        document = reader.read("file:".concat(_fileName));

If the last line contains "file:" or not does not make a difference.
After some debugging I noticed that an URL is made and that it is the
URL
that is opened.
in the debugger I stopped on the error and noticed that in
Handler.openConnection(URL) the protocol is file but in the URL(String,
String, String) that is called from this one, the protocol changed into
ftp. (since no ftp server is running on the windows machine, this error
is
logical)

I tried to do
        document = reader.read(filereader);
but even when I pass an inputstream that is open and has access to the
file, an URL is made and used.

I hope someone can help me with this.

Thank you
Hans


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

------------------------------------------------------- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to