Java Reference
In-Depth Information
produced what looked like the file. But just to be safe, I tested the output of RemCat against
the original file, using the Unix diff comparison program. No news is good news:
$ java network.RemCat localhost foo | diff - /tftpboot/foo
So far so good. Let's not slip this program on an unsuspecting network without exercising
the error handling at least briefly:
$ java network.RemCat localhost nosuchfile
remcat ERROR: File not found
$
URI, URL, or URN?
Problem
Having heard these terms, you want to know the difference between a URI, URL, and URN.
Solution
Read on. Or see the javadoc for java.net.uri .
Discussion
A URL is the traditional name for a network address consisting of a scheme (like “http”) and
an address (site name) and resource or pathname. But there are three distinct terms in all:
▪ URI (Uniform Resource Identifier)
▪ URL (Uniform Resource Locator)
▪ URN (Uniform Resource Name)
A discussion near the end of the Java documentation for the new class explains the relation-
ship among URI, URL, and URN. URIs form the set of all identifiers: URLs and URNs are
subsets.
Search WWH ::




Custom Search