public class FileSeenDatabase extends XMLParser implements ISeenDatabase
DTD_WEB_LOCATION, SCHEMA_WEB_LOCATION
Constructor and Description |
---|
FileSeenDatabase(java.io.File configDir)
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
|
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
|
createDocBuilder, createFactory, deleteNode, domToStr, domToStrNoXMLProlog, encodeAttributeValue, firstChild, fixXMl, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML
public FileSeenDatabase(java.io.File configDir)
configDir
- The configuration directorypublic boolean isSeen(java.io.File mediaDirectory, java.io.File file)
isSeen
in interface ISeenDatabase
mediaDirectory
- The media directory the file lives infile
- The filepublic java.util.Collection<SeenEntry> getEntries()
getEntries
in interface ISeenDatabase
public void markAsSeen(java.io.File mediaDirectory, java.io.File file)
markAsSeen
in interface ISeenDatabase
mediaDirectory
- The media directory the file lives infile
- The filepublic 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)
renamedFile
in interface ISeenDatabase
mediaDirectory
- The media directory the file is located inoldFile
- The old filenamenewFile
- The new filenamepublic void removeFile(java.io.File mediaDirectory, java.io.File file)
removeFile
in interface ISeenDatabase
mediaDirectory
- The media directory of the file to removefile
- The file to remove