public class Handler extends URLStreamHandler
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
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.
| Constructor and Description |
|---|
Handler() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Main dumps rsync file to STDOUT.
|
protected URLConnection |
openConnection(URL u) |
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalFormprotected URLConnection openConnection(URL u)
openConnection in class URLStreamHandlerpublic static void main(String[] args) throws IOException
args - IOExceptionCopyright © 2015 The International Internet Preservation Consortium. All Rights Reserved.