JDK-4464134 : java.net.URI should permit backslashes in opaque URIs
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2001-05-30
  • Updated: 2001-07-19
  • Resolved: 2001-07-19
Related Reports
Relates :  
Description
Date: Tue, 29 May 2001 18:57:19 -0700 (PDT)
From: ###@###.###

Why does URI reject this string : "file:c:\\abc.bat" with the exception:

  java.net.URISyntaxException: Illegal character in opaque part at index 7: file:c:\abc.bat

Assuming a zero-based index, the objection is to the "\".

Comments
EVALUATION Per further discussion with jdn@eng, closing this as WNF. We'll address win32 filename issues in a different way. -- mr@eng 2001/7/18
11-06-2004

SUGGESTED FIX RFC2396 treats "\" as an "unwise" character. The URI class tries to adhere as closely as possible to RFC2396, therefore it rejects "\". Given that over ninety percent of the computers on the planet insist on using "\" in pathnames, however, perhaps we should relax the URI class on this particular point. -- mr@eng 2001/5/30
05-09-0196