-
Bug
-
Resolution: Fixed
-
P4
-
1.1.5, 1.2.0
-
beta
-
generic
-
generic
Problem:
Many programs, including many portions of the JDK manipulate
network URLs and, more generally, URIs, in a purely syntactic
fashion. Syntactic URLs and URIs, for example, are often used
when manipulating HTML and XML documents, where they don't
necessarily denote an actual network resource. They're also
often used as addresses for resources that are accessed by
means other than the usual WWW protocols, for example via JNDI
or JDBC.
Developers have attempted to use the existing java.net.URL
class for these purposes, but there are two difficulties with
this approach.
First, the URL class mixes methods for parsing and accessing
the syntactic components of a URL string together with methods
for opening a connection to the resource identified by the
string. This is problematic for syntactic uses because simply
computing a URL object's hash code or testing it for equality
with another URL will cause a costly domain-name lookup to be
performed.
Second, the URL class implements scheme-specific URL parsing,
which is useful when you're opening a connection but makes it
impossible to use the URL class for schemes for which no stream
handler has been installed.
Proposed API change:
Define a new class, java.net.URI, which only handles the
scheme-independent syntactic aspects of URIs and follows
the relevant Internet standards (RFCs 2396, 2732, and 2373)
as closely as possible.
- duplicates
-
JDK-4221439 https seen as invalid protocol by java.net.URL
-
- Closed
-