This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 46630

Summary: URI has an authority component when opening project
Product: platform Reporter: _ gtzabari <gtzabari>
Component: FilesystemsAssignee: rmatous <rmatous>
Status: CLOSED FIXED    
Severity: blocker CC: gaucho72, jglick, ttran
Priority: P2    
Version: 4.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: Exception that is thrown
The relevant messages.log

Description _ gtzabari 2004-07-27 18:53:58 UTC
dev build 200407270649
JDK 5.0 beta3-b59
fresh userdir

1) Open Project
2) Exception is thrown (attached)
Comment 1 _ gtzabari 2004-07-27 18:54:21 UTC
Created attachment 16490 [details]
Exception that is thrown
Comment 2 _ gtzabari 2004-07-27 18:56:12 UTC
Upgrading to P1 since exception is shown every time you go down a
directory in the file chooser dialog. Highly annoying!
Comment 3 _ ttran 2004-07-27 19:11:15 UTC
Gili, please attach the log file <userdir>/var/log/messages.log
Comment 4 _ gtzabari 2004-07-27 19:23:35 UTC
Created attachment 16491 [details]
The relevant messages.log
Comment 5 rmatous 2004-07-28 12:29:51 UTC
Added additional message. 

Revision  1.104   /cvs/openide/src/org/openide/filesystems/FileUtil.java

Please test with this revision of FileUtil and then attach log file.

I'm not able to reproduce. Messages in you log file has only
informative character and shouldn't be harmful. Then priority
decreaesed to P2.
Comment 6 rmatous 2004-07-28 13:23:24 UTC
*** Issue 45629 has been marked as a duplicate of this issue. ***
Comment 7 rmatous 2004-07-28 15:17:26 UTC
*** Issue 46706 has been marked as a duplicate of this issue. ***
Comment 8 rmatous 2004-07-28 17:32:20 UTC
JFileChooser  impl. on Windows provides
sun.awt.shell.Win32ShellFolder2. Folowing assertions are true for some
instances of Win32ShellFolder2:
Win32ShellFolder2.toURI ().getAuthority() == null;
Win32ShellFolder2.toURI ().toURL ().getAuthority() != null;

Then following call fires IllegalArgumentException because no
authority is excpected:
URI.create(Win32ShellFolder2.toURI ().toURL ().toExternalForm())

Comment 9 rmatous 2004-07-28 17:38:14 UTC
The problem occures for files with path defined according UNC (at
least I think it is so called e.g. \\saaaf004\homes\olscha2\My Documents)
Comment 10 rmatous 2004-07-28 17:56:42 UTC
Sorry, IllegalArgumentException is fired if you need to get back File:

new File (URI.create(Win32ShellFolder2.toURI ().toURL
().toExternalForm()))

In other words. The problem occures if you get Win32ShellFolder2
convert it to URL and then back to File.
Comment 11 _ gtzabari 2004-07-28 20:23:42 UTC
Radek,

   Correct me if I'm wrong, but isn't this a JDK/specification bug?
Shouldn't this be impossible? If so, we should file a bug against JDK
5.0 immediately because as far as I can tell they are about to release
the final version.
Comment 12 rmatous 2004-07-29 12:17:06 UTC
Maybe but I think its a though thing because UNC pathes has difficult
URL interpretation with file protocol. (e.g.
\\myhost.mycompany.com\public\mylib.zip -
file:////myhost.mycompany.com/public/mylib.zip). 

Definitely current MasterFileObject isn't designed to support UNC
pathes anyway (and there isn't planned to support it ). Now there
isn't possible conversion from File to FileObject + reported exception
is fired for informative purposes. If there was urgently needed to
acces files on different hostes via our filesystems then there is
possible use UNC path and map it to regular windows drive just in
windows(e.g. Z:\). 

I think that sufficient fix is to suppres exceptions that uselessly
fill logs.

/cvs/openide/src/org/openide/filesystems/FileUtil.java,v  <--  new
revision: 1.105; previous revision: 1.104
Comment 13 Jesse Glick 2004-07-29 20:40:04 UTC
Radek it sounds to me like a JRE bug if a URL such as

  file:////myhost.mycompany.com/public/mylib.zip

is created from File.toURI. Shouldn't it be e.g.

  file://myhost.mycompany.com/public/mylib.zip

or something along those lines?

At least, it sounds like a JRE bug if

URI.create(someFile.toURI().toURL().toExternalForm())

ever fails.
Comment 14 gaucho72 2004-07-31 15:18:55 UTC
Radek, in my case \\saaaf004\homes\olscha2\My Documents is a local 
offline folder, if I'm connected to the network in our company these 
files will be syncronized with the share on the server. Unplugged I 
can use it as normal local folder (My Documents), but I can't access 
those files to map it to some drive letter, as you suggested.

So working offline I won't be able to access those files via 
Netbeans, what works well with 3.6

This is a common scenario among companies working with Windows-
Clients, so this issue isn't fixed for me.
Comment 15 Jesse Glick 2004-07-31 18:30:44 UTC
gaucho72: your problem should probably be filed as a fresh bug, just
mention this one by number.
Comment 16 _ gtzabari 2004-07-31 22:26:04 UTC
Guys, how is this issue "fixed"? Supressing exceptions is nice and all
but it does not fix the underlying problem. Shouldn't someone in the
Netbeans team file a JDK bug before JDK 5.0 goes final?
Comment 17 rmatous 2004-08-02 10:58:59 UTC
Gili, I file JDK bug (moreover there is definitely possible to
workaround it) but impl. of MasterFileSystem doesn't support UNC names
anyway and I don't plan to add this support for promo-D because I
don't want to destabilize MasterFileSystem code. Its stability is
relatively crucial for the whole product and I think we can live
without support for "Make available offline" functionality on Windows.
Comment 18 Jesse Glick 2004-08-02 12:47:53 UTC
Again: a separate bug report should IMHO be filed about lack of
support for UNC names, so this can be tracked separately.
Comment 19 _ ttran 2004-08-02 12:49:05 UTC
it already was
Comment 20 Jesse Glick 2004-08-02 12:58:01 UTC
Issue #46813, specifically.
Comment 21 rmatous 2004-08-02 13:30:30 UTC
*** Issue 45882 has been marked as a duplicate of this issue. ***
Comment 22 rmatous 2004-08-09 09:58:50 UTC
*** Issue 46975 has been marked as a duplicate of this issue. ***
Comment 23 Marian Mirilovic 2005-12-22 14:26:40 UTC
verified in NB 5.0