dk.netarkivet.common.distribute
Class HTTPRemoteFileRegistry

java.lang.Object
  extended by dk.netarkivet.common.distribute.HTTPRemoteFileRegistry

public class HTTPRemoteFileRegistry
extends java.lang.Object

The embedded webserver handling remote files for HTTPRemoteFile point-to-point communication. Optimised to use direct transfer on local machine.


Method Summary
(package private) static java.net.URL getCleanupUrl(java.net.URL url)
          Get the url for cleaning up after a remote file registered under som URL
static HTTPRemoteFileRegistry getInstance()
          Get the unique instance.
 java.net.URL registerFile(java.io.File file, boolean deletable)
          Register a file for serving to an endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static HTTPRemoteFileRegistry getInstance()
Get the unique instance.

Returns:
The unique instance.

registerFile

public java.net.URL registerFile(java.io.File file,
                                 boolean deletable)
Register a file for serving to an endpoint.

Parameters:
file - The file to register.
deletable - Whether it should be deleted on cleanup.
Returns:
The URL it will be served as.
Throws:
ArgumentNotValid - on null or unreadable file.
IOFailure - on any trouble registerring the file

getCleanupUrl

static java.net.URL getCleanupUrl(java.net.URL url)
                           throws java.net.MalformedURLException
Get the url for cleaning up after a remote file registered under som URL

Returns:
the cleanup url.
Throws:
java.net.MalformedURLException