Using the URL Classes

Before jumping into the classes that are provided by the Java core API for dealing with URLs and the Web, you need to understand what is being referred to as URLs.

What Are URLs?

The primary classification of URLs is the scheme, which usually corresponds to an application protocol. Schemes include HTTP, FTP, Telnet, and Gopher. The rest of the URL syntax is in a format that depends on the scheme. A colon separates these two portions of information:

scheme-name:scheme-info

Thus, while mailto:chuckcavaness@yahoo.com indicates "send mail to user 'chuckcavaness'at the machine yahoo.com," ftp://chuckcavaness@foobar.org means "open an FTP connection to foobar.org and log in as user chuckcavaness."

Although IP addresses uniquely ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.