Java Reference
In-Depth Information
used protocol for accessing files over the internet. Generally, the files are
html files, but they could be any files, including text files, .jpg files, and
.gif files. A domain name must be given.
2. file : This is used for a file that is on the local computer. The domain name
is generally not present.
3. ftp : The File Transfer Protocol protocol provides for files and directories
of files to be transferred from one computer to another.
4. mailto : Used to bring up a window that can be used to send mail. The //
and domain name are omitted, and instead of a path there is an email
address, e.g. consider this URL:
Domain names, or hosts
The appearance of "//" in the URL signals the beginning of a domain name,
which is a name that has been registered as being assigned to or associated with
a particular computer. Here are examples of domain names:
Domain names generally consist of a sequence of names separated by peri-
ods "." . It used to cost about $75 per year to register a domain name. The price
has dropped to between $10 and $75. Here is the URL for the web page
( for the company Internet Corporation For Assigned
Names and Numbers , which maintains the rules for domain names.
The internet started with domain names that ended in: .com (for commer-
cial ), .org ( organization ), .gov ( government ), and .mil ( military ). Lately, new
ones were added, like .biz ( business ), .info ( information ), .net ( internet ), and
.name ( for individuals ) Also, any country can have a two-letter ending. Some
examples are .af (Afghanistan), .de (Germany), and .hk (Hong Kong). The
suffix .us exists for the United States, but it is not used much.
The domain-name part of a URL is often called the host —that name is used
later, so remember it.
A URL can optionally specify a port , which is the port number to which the
connection is made on the remote host machine. If the port is not specified, the
default port for the protocol is used instead. For example, the default port for
http is 80 . The following example contains the port number 8080 :
We do not deal with ports since they are usually not given in the URLs that we
deal with.
Search WWH ::

Custom Search