Friday, 26 September 2014

In Detail : What Is URI, URL , URN

URI :

    URI stands for Uniform Resource Identifier. A URI is the most general. A URI is parsed for basic syntax without regard to the scheme, if any, that it specifies, and it need not refer to a particular server. URL and URN are subcategories of URI.

The string form of URI has the syntax
[scheme:]scheme-specific-part[#fragment]

The components inside square brackets [..] are optional. The URIs are of two types
1. An absolute URI - specifies a scheme.
2. A relative URI - which doesn't specify a scheme.

URIs are classified according to whether they are opaque or hierarchical.

Opaque URI :
     An opaque URI is an absolute URI whose scheme-specific part doesn't begin with a slash character ('/'). Some examples are

mailto:speakingcs@gmail.com

Hierarchical URI :
    A hierarchical URI is either absolute URI whose scheme-specific part begins with a slash('/') character, or a relative URI, that doesn't specify a scheme.

Some examples are :
http://www.speakingcs.com
file:///Docs

URL :

    URL stands for Uniform Resource Locator . A URL is the traditional name for a network address consisting of a scheme (like "http") and an address (site name) and resource or path name.A URL includes a host name, scheme, and other components. The URL string is parsed according to rules for its scheme. The scheme can be "http","https","ftp". When you construct a URL, an Input Stream is created automatically. Every URL is a URI, but not every URI is URL. examples are
   
    http://www.speakingcs.com

URN :

    URN stands for Uniform Resource Name. URN is subcategory of URI. URNs name resources but don't explain how to locate them, typical examples of URNs, you have seen include

mailto:java-net@java.sun.com   
news:comp.lang.java   
urn:isbn:096139210x

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.