org.xnap.io
Class ResumeRepository

java.lang.Object
  extended by org.xnap.io.ResumeRepository

public class ResumeRepository
extends java.lang.Object

Provides a binary repository that stores File objects. This class can be used to store download files that need to be resumed later.

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


Constructor Summary
ResumeRepository()
           
 
Method Summary
 void add(java.io.File file)
          Adds file to the repository.
 java.util.Iterator iterator()
          Returns an iterator over all items in the repository.
 boolean read(java.lang.String filename, java.lang.String fallbackPath)
          Reads File objects from filename and adds them to the repository.
 void remove(java.io.File file)
          Removes file from the repository.
 void write(java.lang.String filename)
          Writes repository content to filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResumeRepository

public ResumeRepository()
Method Detail

add

public void add(java.io.File file)
Adds file to the repository.


iterator

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


remove

public void remove(java.io.File file)
Removes file from the repository.


read

public boolean read(java.lang.String filename,
                    java.lang.String fallbackPath)
             throws java.io.IOException
Reads File objects from filename and adds them to the repository.

Parameters:
filename - the name of the repository file
fallbackPath - if a file in the repository does not exist, it is looked up in this path
Returns:
true, if all File objects were read successfully or repository did not exist; false, otherwise
Throws:
java.io.IOException
See Also:
add(File)

write

public void write(java.lang.String filename)
           throws java.io.IOException
Writes repository content to filename.

Throws:
java.io.IOException


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