 |
JAVA AND URLs |
 |
THE BASIC IDEA
-
The Java programming language was designed with network programming and
particularly the World Wide Web in mind. Thus, Java provides facilities
for manipulating Uniform Resource Locators (URLs), and downloading data
from the Web.
-
Java provides a URL class which can encode the protocol, hostname, port,
path, filename, and other fields contained within a standard URL.
-
The URL class also contains methods for downloading the contents specified
by a URL. One method creates an input stream on a URL resource which can
then be read from as usual. Another method downloads the contents specified
by a URL and tries to interpret it into an object (if the URL refers to a
GIF image for example, an object of type
ImageProducer is returned).