public class DatabaseSeenDatabase extends java.lang.Object implements ISeenDatabase
Constructor and Description |
---|
DatabaseSeenDatabase(DBResource resource)
The constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<SeenEntry> |
getEntries()
Uses to get a list of seen entries
|
boolean |
isSeen(java.io.File mediaDirectory,
java.io.File file)
Used to work out if a file has been seen already
|
void |
markAsSeen(java.io.File mediaDirectory,
java.io.File file)
Used to mark a file as seen after actions have seen it
|
long |
numberOfEntries()
Used to count the number of seen entries
|
void |
read(IProgressMonitor progress)
Used to read the database from disk
|
void |
removeFile(java.io.File mediaDirectory,
java.io.File file)
Used to remove files from the Seen database
|
void |
renamedFile(java.io.File mediaDirectory,
java.io.File oldFile,
java.io.File newFile)
Used to notify the seen database when a file has been renamed
|
void |
write(IProgressMonitor parentMonitor)
Used to write the database to disc
|
public DatabaseSeenDatabase(DBResource resource) throws SeenDBException
resource
- The database resurceSeenDBException
- Thrown if their are any problemspublic boolean isSeen(java.io.File mediaDirectory, java.io.File file) throws SeenDBException
isSeen
in interface ISeenDatabase
mediaDirectory
- The media directory the file lives infile
- The fileSeenDBException
- Thrown if their is a problempublic void markAsSeen(java.io.File mediaDirectory, java.io.File file) throws SeenDBException
markAsSeen
in interface ISeenDatabase
mediaDirectory
- The media directory the file lives infile
- The fileSeenDBException
- Thrown if their is a problempublic void write(IProgressMonitor parentMonitor) throws SeenDBException
write
in interface ISeenDatabase
parentMonitor
- Parent progress monitorSeenDBException
- Thrown if their is a problempublic void read(IProgressMonitor progress) throws SeenDBException
read
in interface ISeenDatabase
progress
- Progress monitorSeenDBException
- Thrown if their is a problempublic void renamedFile(java.io.File mediaDirectory, java.io.File oldFile, java.io.File newFile) throws SeenDBException
renamedFile
in interface ISeenDatabase
mediaDirectory
- The media directory the file is located inoldFile
- The old filenamenewFile
- The new filenameSeenDBException
- Thrown if their is a problempublic void removeFile(java.io.File mediaDirectory, java.io.File file) throws SeenDBException
removeFile
in interface ISeenDatabase
mediaDirectory
- The media directory of the file to removefile
- The file to removeSeenDBException
- Thrown if their is a problempublic java.util.Collection<SeenEntry> getEntries()
getEntries
in interface ISeenDatabase
public long numberOfEntries()