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.
Especially '#' in a path component of a FileObject must be escaped and cannot be left as is in an nbfs: URL. Looks like '#' in file system names are escaped but not paths within a file system - with core/localfs this will become more of a problem I guess. '?' is also a special character for URLs.
Specifically, got on console: URI "nbfs:QBspaceQBsrc/ant/src/etc/testcases/core/include/frag#ment/include.inc" has a fragment ID. while doing a text search /space/src, which includes the subdir ant/ containing Apache Ant sources.
Do you think, that we need to keep strange escaping mechanism with 'Q' prefix ? I would like to replace it with %xy pattern which everybody is familier with. I expect, that backward compatibility (decode) must be kept, but encoding can be completely replaced.
Completely agreed. One idea for how to make such a change compatible: move the name of the file system into the 'host' part of the URL. That should be enough to unambiguously distinguish old nbfs: URLs from the new. E.g. nbfs://%2Fspace%2Fsrc%2Fnb_all%2Fcore%2Fsrc/org/netbeans/core/modules/package.html Another possibility is to simply use a different URL protocol, e.g. nbfile:/%2Fspace%2Fsrc%2Fnb_all%2Fcore%2Fsrc/org/netbeans/core/modules/package.html Anyway getting rid of the weird Q-escapes would be very nice.
Fixed in trunk. /cvs/openide/execution/src/org/openide/execution/NbfsURLConnection.java,v <-- NbfsURLConnection.java new revision: 1.5; previous revision: 1.4 /cvs/openide/src/org/openide/filesystems/FileURL.java,v <-- FileURL.java new revision: 1.19; previous revision: 1.18 /cvs/openide/src/org/openide/filesystems/NbfsUtil.java,v <-- NbfsUtil.java initial revision: 1.1
I would be valuable to add also some test cases. I'd bet you had some anyway to test the behaviour, so just turn them into NbTestCase please.
Test added. /cvs/openide/test/unit/src/org/openide/filesystems/FileObjectTestHid.java,v <-- FileObjectTestHid.java new revision: 1.15; previous revision: 1.14
A test is there and seems to call decode & encode URL methods.
Is <nbfs://%2Fhome%2Fpk97937%2Fbugs/is34/x317/emptyDTD.dtd> valid URL? Parser denies to accept it. Original nbfs coding scheme used Q escaping. I cannot render the specification <http://www.ietf.org/rfc/rfc2396.txt>. So I tried Mozilla and it also denies URLs that contain escaping in host name. Escaping is OK in path. Please resolve soon as issue 34317 is Q-build blocker.
Appendix A reads: hostname = *( domainlabel "." ) toplabel [ "." ] domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum toplabel = alpha | alpha *( alphanum | "-" ) alphanum So really escaped is not allowed in host name.
Could somebody please do something about it ? This bug prevents issue #34317 to be fixed and thus takes over its Q-build showstopper attribute ! Increasing prirority ...
Fixed in trunk: /cvs/openide/src/org/openide/filesystems/NbfsUtil.java,v <-- NbfsUtil.java new revision: 1.2; previous revision: 1.1 and also in QBE200306250100: /cvs/openide/src/org/openide/filesystems/NbfsUtil.java,v <-- NbfsUtil.java new revision: 1.1.8.1; previous revision: 1.1
I'm verifying it because fix is solving performance problem mentioned in the issue #34456 Maybe that issue is duplicate of this one...
Verified, the fix is solving problem mentioned in the issue #34317.