org.directwebremoting.impl
Class PurgingDownloadManager

java.lang.Object
  extended by org.directwebremoting.impl.PurgingDownloadManager
All Implemented Interfaces:
DownloadManager
Direct Known Subclasses:
FileStoreDownloadManager, InMemoryDownloadManager

public abstract class PurgingDownloadManager
extends java.lang.Object
implements DownloadManager

A DownloadManager that simply stores downloads in memory until they are requested and then removes them.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Nested Class Summary
 class PurgingDownloadManager.DownloadPurge
          Loop over the known downloads removing the ones that are out of date
 
Constructor Summary
PurgingDownloadManager()
          Schedule cache purges
 
Method Summary
 java.lang.String addFile(FileGenerator generator)
          Inject a file into the system for later download.
 FileGenerator getFile(java.lang.String id)
          Retrieve a file previously injected into the system with DownloadManager.addFile(FileGenerator)
 void setDownloadHandlerUrl(java.lang.String downloadHandlerUrl)
          The URL part which we attach to the downloads.
 void setPurgeDownloadsAfter(long purgeDownloadsAfter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurgingDownloadManager

public PurgingDownloadManager()
Schedule cache purges

Method Detail

addFile

public java.lang.String addFile(FileGenerator generator)
                         throws java.io.IOException
Description copied from interface: DownloadManager
Inject a file into the system for later download.

Specified by:
addFile in interface DownloadManager
Parameters:
generator - The representation of the file to inject
Returns:
A URL for how to allow download of this data at a later time
Throws:
java.io.IOException - If there are problems reading from the FileGenerator

getFile

public FileGenerator getFile(java.lang.String id)
Description copied from interface: DownloadManager
Retrieve a file previously injected into the system with DownloadManager.addFile(FileGenerator)

Specified by:
getFile in interface DownloadManager
Parameters:
id - The id of the FileGenerator to retrieve

setDownloadHandlerUrl

public void setDownloadHandlerUrl(java.lang.String downloadHandlerUrl)
The URL part which we attach to the downloads.

Parameters:
downloadHandlerUrl - The URL for this Handler.

setPurgeDownloadsAfter

public void setPurgeDownloadsAfter(long purgeDownloadsAfter)
Parameters:
purgeDownloadsAfter - the purgeDownloadsAfter to set

Copyright ¬ 2005