Working with URLs in Java

So far, this chapter has covered fairly low-level programming for programs that use networking. Although you can send any kind of data across a socket, sockets are not the best way to access a URL (Uniform Resource Locator) on the World Wide Web. This section shows how to use URLs in your Java program. You can read from a URL or check a URL for validity even if you are not running a program on the Web. A URL provides a unique domain name or address to access a remote system, using a Web browser or other program that can access the Web. The classes to support accessing URLs are in, as are the other networking classes shown so far. The class provides a class that represents a URL on the Web. This ...

Get PURE Java™ 2 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.