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.
Summary: | FileURL (& NbfsURLConnection) need to handle strange file characters better | ||
---|---|---|---|
Product: | platform | Reporter: | Jesse Glick <jglick> |
Component: | Filesystems | Assignee: | rmatous <rmatous> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | jtulach, pkuzel |
Priority: | P3 | Keywords: | SPACE_IN_PATH |
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 39613 | ||
Bug Blocks: | 34317 |
Description
Jesse Glick
2003-03-10 20:41:35 UTC
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. |