org.alliance.core.file.filedatabase
Class FileDatabase
java.lang.Object
org.alliance.core.file.filedatabase.FileDatabase
public class FileDatabase
- extends java.lang.Object
Created by IntelliJ IDEA.
User: maciek
Date: 2006-jan-06
Time: 15:49:43
To change this template use File | Settings | File Templates.
|
Constructor Summary |
FileDatabase(java.lang.String indexFilePath,
java.lang.String databaseFilePath)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MINIMUM_TIME_BETWEEN_FLUSHES_IN_MS
public static final int MINIMUM_TIME_BETWEEN_FLUSHES_IN_MS
- See Also:
- Constant Field Values
VERSION
public static final int VERSION
- See Also:
- Constant Field Values
FileDatabase
public FileDatabase(java.lang.String indexFilePath,
java.lang.String databaseFilePath)
throws java.io.IOException
- Throws:
java.io.IOException
isEmpty
public boolean isEmpty()
throws java.io.IOException
- Throws:
java.io.IOException
add
public FileDescriptor add(FileDescriptor fd)
throws java.io.IOException
- Parameters:
fd -
- Returns:
- null if everything is ok. If the hash root is aldready in database the older FD is returned (the one in database, not the one sent to this method)
- Throws:
java.io.IOException
getFd
public FileDescriptor getFd(int index)
throws java.io.IOException
- Throws:
java.io.IOException
getFd
public FileDescriptor getFd(Hash hash)
throws java.io.IOException
- Throws:
java.io.IOException
getNumberOfFiles
public int getNumberOfFiles()
printToSout
public void printToSout()
throws java.io.IOException
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Throws:
java.io.IOException
cleanupDuplicates
public void cleanupDuplicates()
contains
public boolean contains(java.lang.String path)
throws java.io.IOException
- Throws:
java.io.IOException
contains
public boolean contains(Hash rootHash)
getKeywordIndex
public KeywordIndex getKeywordIndex()
getTotalSize
public long getTotalSize()
getAllHashes
public java.util.Set<Hash> getAllHashes()
search
public FileDescriptor[] search(java.lang.String query,
int maxHits,
FileType ft)
throws java.io.IOException
- Throws:
java.io.IOException
isDuplicate
public boolean isDuplicate(java.lang.String fullPath)
throws java.io.IOException
- Throws:
java.io.IOException
getDuplicates
public java.util.Collection<java.lang.String> getDuplicates()
getHashForDuplicate
public Hash getHashForDuplicate(java.lang.String path)