Why is this URI valid according to RCF 2396 standards?

I have been playing around with non-viscous types for an application loader that I was developing. As a typo, I forgot to include the protocol portion of a specific URI. I was expecting the java test to fail due to the wrong URI ... however this statement seems to work ...

URI uri = URI.create("contacts.addresses.genericAddress")

      

There is no standard for me to use a point as part of a schematic ... and I thought that a schematic part was always required?

Does anyone know why?

+3


source to share


1 answer


I'll add my comment as an answer because I think it's correct:



From the Java documentation URI: "Given by the grammar in RFC 2396 Appendix A" and append A, allows the URI to be a relative path with no hostname or schema. Thus, "this.and.that" can be just a filename such as "this.html" (the dot is valid as the filename of the file, ie Pchars in the path segment).

+2


source







All Articles