| java.lang.Object java.net.URLStreamHandler org.archive.net.md5.Handler
Handler | public class Handler extends URLStreamHandler (Code) | | A protocol handler for an 'md5' URI scheme.
Md5 URLs look like this: md5:deadbeefdeadbeefdeadbeefdeadbeef
When this handler is invoked against an md5 URL, it passes the raw md5 to
the configured script as an argument. The configured script then does the
work to bring the item pointed to by the md5 local so we can open a Stream
on the local copy. Local file is deleted when we finish. Do
org.archive.net.DownloadURLConnection.getFile to get name of
temporary file.
You need to define the system property
-Djava.protocol.handler.pkgs=org.archive.net to add this handler
to the java.net.URL set. Also define system properties
-Dorg.archive.net.md5.Md5URLConnection.path=PATH_TO_SCRIPT to
pass path of script to run as well as
-Dorg.archive.net.md5.Md5URLConnection.options=OPTIONS for
any options you'd like to include. The pointed-to PATH_TO_SCRIPT
will be invoked as follows: PATH_TO_SCRIPT OPTIONS MD5
LOCAL_TMP_FILE . The LOCAL_TMP_FILE file is made in
java.io.tmpdir using java tmp name code.
author: stack |
Methods inherited from java.net.URLStreamHandler | protected boolean equals(URL u1, URL u2)(Code)(Java Doc) protected int getDefaultPort()(Code)(Java Doc) protected synchronized InetAddress getHostAddress(URL u)(Code)(Java Doc) protected int hashCode(URL u)(Code)(Java Doc) protected boolean hostsEqual(URL u1, URL u2)(Code)(Java Doc) abstract protected URLConnection openConnection(URL u) throws IOException(Code)(Java Doc) protected URLConnection openConnection(URL u, Proxy p) throws IOException(Code)(Java Doc) protected void parseURL(URL u, String spec, int start, int limit)(Code)(Java Doc) protected boolean sameFile(URL u1, URL u2)(Code)(Java Doc) protected void setURL(URL u, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref)(Code)(Java Doc) protected void setURL(URL u, String protocol, String host, int port, String file, String ref)(Code)(Java Doc) protected String toExternalForm(URL u)(Code)(Java Doc)
|
|
|