Link Protocol

A URL tells you how to find a resource. A link: URL provides a level of indirection: It tells you how to find a resource which contains the URL of the real resource.

When connecting to a link: URL, a new URL is created by stripping the link: prefix. The input stream obtained from this stripped URL is parsed as plain text. The first non-empty and non-comment line is taken to be the URL for the real resource. Comment lines start with a hash '#' character, optionally preceded by whitespace.


link-uri := 'link:' any-uri 



The content of the link file can look like this

# This is a comment
# followed by some empty lines


Links to classpath URLs can be useful for libraries to provide a default URL which a user may override by prepending the classpath with a library of their own containing a resource of the same name: