Working with URL in Java Tutorial

Uniform Resource Locator (URL) is a address or reference to a resource on the internet. When we use the term URL in java network programming , we use it to connect and retrieve information from the internet.

Now lets see the structure of the URL

URL is basically divided into two parts

1. Protocol Identifier
2. Resource Name



As we notice in above image both protocol identifier and resource name are separated by colon and two forward slashes.
On the left hand side we can see the protocol mentioned which is actually a protocol identifier , in this case it is http which hypertext transfer protocol. It can have lot of other protocols such as FTP , file or news.

On the right hand side we can see the resource name which is nothing but the complete address of the resource. The format of the resource name varies according to the protocol is being used. Normally resource name contains many components such as host name, file name, port number or reference. Normally host name and file name is required for many protocols whereas port and reference we can keep it as optional.
Share on Google Plus

About Pranav

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

2 comments:

  1. Exmretely helpful article, please write more.

    ReplyDelete
  2. Hey there, You've done an incredible job. I'll certainly digg it and personally suggest to my friends.
    I'm sure they will be benefited from this site.

    ReplyDelete