org.alliance.core.file
Class FileManager
java.lang.Object
org.alliance.core.Manager
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileManager
public FileManager(CoreSubsystem core,
Settings settings)
throws java.io.IOException
- Throws:
java.io.IOException
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()