Article View: borland.public.jbuilder.java.api
Article #2696Re: Trouble with file:// protocol handling in Sun JDK 1.2.2
From: Trejkaz Xaoza
Date: Thu, 08 Jun 2000 00:00
Date: Thu, 08 Jun 2000 00:00
20 lines
1390 bytes
1390 bytes
Andrey Zakharchook wrote: > When I pass as fileName string like a "file:\\\\C:\\filename.txt" > all works OK under MS JVM and IBM JDK 1.1.8, but under > Sun JDK 1.1.2 I've got UnknownHostException, because under MS and IBM JVMs > connection is instance of sun.net.www.protocol.file.FileURLConnection class > and under Sun it is sun.net.www.protocol.ftp.FtpURLConnection. > > So, if I'm not mistaken, Sun handles file:// protocol as FTP, but it isn't > correct, eh? > And can anyone of all give me some hint how can I write really portable code > in this case. I've had the file:// work in numerous situations under JDK1.1.x and JDK1.2.2. There's only one thing I see to be wrong with your scenario and that's the use of backslashes in the URI. Try file:///C:/filename.txt and see if that works. TX
Technical Details
Message-ID:
<393F24AE.7CDF6124@darker.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<393e2049@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,45a89284763b95e6 X-Google-Attributes: gid1089d0,public From: Trejkaz Xaoza <trejkaz@darker.net> Subject: Re: Trouble with file:// protocol handling in Sun JDK 1.2.2 Date: 2000/06/08 Message-ID: <393F24AE.7CDF6124@darker.net> X-Deja-AN: 632464731 Content-Transfer-Encoding: 7bit References: <393e2049@dnews> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api