org.alliance.core.file
Class FileManager

java.lang.Object
  extended by org.alliance.core.Manager
      extended by org.alliance.core.file.FileManager

public class FileManager
extends Manager

Keeps track of all files used in Alliance. Contains the ShareManager, DownloadStorage and AutomaticUpgrade. Should contain FileDatabase but it's actually contained in the ShareManager. Also contains the CacheStorage (that's hardly used right now).

This is the place to check if we have a certain root hash (complete or incomplete), to get FileDescriptors and to do file searches.

See Also:
DownloadStorage, ShareManager, AutomaticUpgrade, FileDatabase Created by IntelliJ IDEA. User: maciek Date: 2006-jan-22 Time: 19:02:07 To change this template use File | Settings | File Templates.

Constructor Summary
FileManager(CoreSubsystem core, Settings settings)
           
 
Method Summary
 boolean contains(Hash root)
           
 boolean containsComplete(Hash root)
           
 AutomaticUpgrade getAutomaticUpgrade()
           
 BlockMask getBlockMask(Hash root)
           
 BlockStorage getBlockStorageFor(Hash root)
           
 CacheStorage getCache()
           
 DownloadStorage getDownloadStorage()
           
 FileDescriptor getFd(Hash root)
           
 FileDatabase getFileDatabase()
           
 ShareManager getShareManager()
           
 long getTotalBytesShared()
           
 boolean hasBlock(Hash rootHash, int blockNumber)
           
 void init()
           
 boolean isRecentlyDownloadedOrComplete(Hash rootHash)
           
 FileDescriptor[] search(java.lang.String query, int maxHits, FileType ft)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManager

public FileManager(CoreSubsystem core,
                   Settings settings)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

init

public void init()
          throws java.io.IOException
Specified by:
init in class Manager
Throws:
java.io.IOException

getShareManager

public ShareManager getShareManager()

shutdown

public void shutdown()
              throws java.io.IOException
Throws:
java.io.IOException

contains

public boolean contains(Hash root)

search

public FileDescriptor[] search(java.lang.String query,
                               int maxHits,
                               FileType ft)
                        throws java.io.IOException
Throws:
java.io.IOException

getTotalBytesShared

public long getTotalBytesShared()

containsComplete

public boolean containsComplete(Hash root)

getBlockMask

public BlockMask getBlockMask(Hash root)
                       throws java.io.IOException
Throws:
java.io.IOException

getFd

public FileDescriptor getFd(Hash root)
                     throws java.io.IOException
Throws:
java.io.IOException

getBlockStorageFor

public BlockStorage getBlockStorageFor(Hash root)

getCache

public CacheStorage getCache()

getDownloadStorage

public DownloadStorage getDownloadStorage()

hasBlock

public boolean hasBlock(Hash rootHash,
                        int blockNumber)
                 throws java.io.IOException
Throws:
java.io.IOException

getFileDatabase

public FileDatabase getFileDatabase()

isRecentlyDownloadedOrComplete

public boolean isRecentlyDownloadedOrComplete(Hash rootHash)

getAutomaticUpgrade

public AutomaticUpgrade getAutomaticUpgrade()