public class DigestFileSet
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected com.lf.commons.task.BackgroundTask |
bgTask
The background task (optional).
|
protected com.lf.commons.lang.OrderedHashtable<java.io.File,java.util.Vector<DigestResult>> |
cacheAllDigests
Remembers all imported digest files (key: digest file, value: digests inside).
|
protected com.lf.commons.lang.OrderedHashtable<java.io.File,java.util.Vector<DigestResult>> |
cacheBestDigests
Remembers the best digests per target (key: target file, value: digests, one per algorithm).
|
protected com.lf.commons.lang.OrderedHashtable<java.io.File,FileResult> |
cacheFileResults
Remembers the statistics per digest file (key: digest file, value: digest file data).
|
protected int[] |
filetypes
The digest files to look for
FileResult.TYPE_GNU_SINGLE, ... |
protected boolean |
verbose
Verbose messages?
|
| Constructor and Description |
|---|
DigestFileSet()
Constructor method for i18n purposes only.
|
DigestFileSet(java.util.Vector<java.io.File> directories,
boolean subdirs,
int[] filetypes,
boolean verbose,
com.lf.commons.config.Configuration checkoptions,
java.util.Vector<com.lf.commons.io.SuffixFilter> filters,
com.lf.commons.task.BackgroundTask bgtask,
java.lang.String comment)
Constructor method.
|
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
checkXMLEntrySize(DigestResult result)
Target file size matches XML entry file size?
|
protected static boolean |
checkXMLEntryTimestamp(DigestResult result)
Target file timestamp matches XML entry timestamp?
|
void |
debugPrint()
Prints the caches currently managed by this object.
|
protected void |
finalize()
Clean-up method to help the gc.
|
java.util.Vector<java.io.File> |
findBestDigests(java.util.Vector<java.io.File> targets,
java.util.Vector<java.lang.String> algos,
boolean gnubsdtimestamp,
boolean pgptimestamp,
boolean xmltimestamp,
boolean xmlentrysize,
boolean xmlentrytimestamp,
boolean expectintermediates,
boolean ignoremissing,
boolean pgpsigs)
Determines the best matching digests for the target files from the caches.
|
java.util.Vector<DigestResult> |
getAllDigests(java.io.File digestfile)
Provides the digests from a certain digest file.
|
int |
getBestDigestCount()
Provides the number of best-matching digests in cache.
|
java.util.Vector<DigestResult> |
getBestDigests()
Provides the best-matching digests in cache.
|
java.util.Vector<DigestResult> |
getBestDigests(java.io.File file)
Provides the best-matching digests in cache.
|
java.util.Vector<java.io.File> |
getBestDigestTargets()
Provides the target files for the best-matching digests in cache.
|
int |
getDigestCount(java.util.Vector<java.io.File> digestfiles)
Provides the number of digests in cache (without intermediates).
|
java.util.Vector<java.io.File> |
getDigestFiles(java.io.File target)
Collects the relevant digest files for the given target.
|
java.util.Vector<java.io.File> |
getDigestFiles(int filetype)
Collects the digest files of the given type in the internal cache.
|
long |
getXMLEntrySize(java.io.File file)
Provides the file size from the XML document.
|
long |
getXMLEntryTimestamp(java.io.File file)
Provides the file timestamp from the XML document.
|
java.util.Vector<java.io.File> |
removeArtifacts()
Removes the digest files where all digests have no target.
|
java.util.Vector<java.io.File> |
removeOtherFormats(int[] filetypes)
Removes the digest files in other formats.
|
void |
removeTarget(java.io.File target)
Removes the results for the given ignored target.
|
protected int[] filetypes
FileResult.TYPE_GNU_SINGLE, ...protected boolean verbose
protected com.lf.commons.task.BackgroundTask bgTask
protected com.lf.commons.lang.OrderedHashtable<java.io.File,java.util.Vector<DigestResult>> cacheAllDigests
protected com.lf.commons.lang.OrderedHashtable<java.io.File,FileResult> cacheFileResults
protected com.lf.commons.lang.OrderedHashtable<java.io.File,java.util.Vector<DigestResult>> cacheBestDigests
public DigestFileSet()
throws java.lang.InstantiationException
I18NExtractor).
java.lang.InstantiationException - Error indicationpublic DigestFileSet(java.util.Vector<java.io.File> directories,
boolean subdirs,
int[] filetypes,
boolean verbose,
com.lf.commons.config.Configuration checkoptions,
java.util.Vector<com.lf.commons.io.SuffixFilter> filters,
com.lf.commons.task.BackgroundTask bgtask,
java.lang.String comment)
throws java.lang.InterruptedException
directories - The directories to be scanned for digest filessubdirs - Include sub-directories?filetypes - The digest files to look for FileResult.TYPE_GNU_SINGLE, ...verbose - Verbose messages?checkoptions - The values from CheckOptionsWindowfilters - The suffix filtersbgtask - The background task (optional)comment - The default commentjava.lang.InterruptedException - If task has been cancelledprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable - Error indicationpublic java.util.Vector<java.io.File> findBestDigests(java.util.Vector<java.io.File> targets,
java.util.Vector<java.lang.String> algos,
boolean gnubsdtimestamp,
boolean pgptimestamp,
boolean xmltimestamp,
boolean xmlentrysize,
boolean xmlentrytimestamp,
boolean expectintermediates,
boolean ignoremissing,
boolean pgpsigs)
targets - The base set of target filesalgos - The algorithms to search forgnubsdtimestamp - Match conditionpgptimestamp - Match conditionxmltimestamp - Match conditionxmlentrysize - Match conditionxmlentrytimestamp - Match conditionexpectintermediates - Intermediates expected?ignoremissing - Ignore missing intermediates?pgpsigs - PGP signatures?protected static boolean checkXMLEntrySize(DigestResult result)
result - The result to checkprotected static boolean checkXMLEntryTimestamp(DigestResult result)
result - The result to checkpublic long getXMLEntrySize(java.io.File file)
file - The target file to checkpublic long getXMLEntryTimestamp(java.io.File file)
file - The target file to checkpublic int getBestDigestCount()
public int getDigestCount(java.util.Vector<java.io.File> digestfiles)
digestfiles - The cachepublic java.util.Vector<DigestResult> getBestDigests()
public java.util.Vector<DigestResult> getBestDigests(java.io.File file)
file - The desired filepublic java.util.Vector<java.io.File> getBestDigestTargets()
public java.util.Vector<java.io.File> removeOtherFormats(int[] filetypes)
filetypes - The desired types FileResult.TYPE_GNU_SINGLE, ...public java.util.Vector<java.io.File> removeArtifacts()
public void debugPrint()
public java.util.Vector<java.io.File> getDigestFiles(int filetype)
filetype - The desired type FileResult.TYPE_GNU_SINGLE, ...public java.util.Vector<java.io.File> getDigestFiles(java.io.File target)
target - The target filepublic java.util.Vector<DigestResult> getAllDigests(java.io.File digestfile)
digestfile - The digest filenull otherwisejava.lang.NullPointerException - If a parameter is nullpublic void removeTarget(java.io.File target)
target - The ignored targetCopyright © 2005-2015 Leisenfels UG. All rights reserved.