org.xnap.plugin.opennap.net
Class OpenNapResumeRepository

java.lang.Object
  extended by org.xnap.plugin.opennap.net.OpenNapResumeRepository

public class OpenNapResumeRepository
extends java.lang.Object

Provides a repository that handles the resume information for downloads in the incomplete directory.

This class is mostly thread safe (except for iterator()).


Field Summary
static java.lang.String FILENAME_PREFIX
          The prefix used for resume files.
 
Constructor Summary
OpenNapResumeRepository()
           
 
Method Summary
 void add(java.io.File path, OpenNapDownloadContainerData download)
          Adds a download to the repository.
 java.util.Iterator iterator()
          Returns an iterator over all items in the repository.
 void remove(OpenNapDownloadContainerData download)
          Removes a download from the repository, i.e. when the download has succeeded.
 void restore(java.io.File path)
          Scans a directory for resume files and adds the found downloads.
 void save(java.io.File path)
          Writes repository content to filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILENAME_PREFIX

public static final java.lang.String FILENAME_PREFIX
The prefix used for resume files.

See Also:
Constant Field Values
Constructor Detail

OpenNapResumeRepository

public OpenNapResumeRepository()
Method Detail

add

public void add(java.io.File path,
                OpenNapDownloadContainerData download)
Adds a download to the repository. Creates a resume data file in path.

Parameters:
path - the incomplete directory

iterator

public java.util.Iterator iterator()
Returns an iterator over all items in the repository.


remove

public void remove(OpenNapDownloadContainerData download)
Removes a download from the repository, i.e. when the download has succeeded.


restore

public void restore(java.io.File path)
Scans a directory for resume files and adds the found downloads.

Parameters:
path - the directory to scan
See Also:
#add(OpenNapDownloadContainerData)

save

public void save(java.io.File path)
Writes repository content to filename.



Copyright © 2001-2005 XNap Team. All Rights Reserved.