public class DigestURLSet
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.OrderedTreeMap<org.apache.commons.vfs2.FileObject,java.util.Vector<DigestResult>> |
cacheAllDigests
Remembers all imported digest URLs (key: digest URL, value: digests inside).
|
protected com.lf.commons.lang.OrderedTreeMap<org.apache.commons.vfs2.FileObject,java.util.Vector<DigestResult>> |
cacheBestDigests
Remembers the best digests per target (key: target URL, value: digests, one per algorithm).
|
protected com.lf.commons.lang.OrderedTreeMap<org.apache.commons.vfs2.FileObject,URLResult> |
cacheURLResults
Remembers the statistics per digest URL (key: digest URL, value: digest URL data).
|
protected long |
maxurlsize
The maximum size to add URLs to cache.
|
protected java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> |
urlCache
The cache for digest file contents (optional).
|
protected int[] |
urltypes
The digest URLs to look for
FileResult.TYPE_GNU_SINGLE , ... |
protected boolean |
verbose
Verbose messages?
|
Constructor and Description |
---|
DigestURLSet()
Constructor method for i18n purposes only.
|
DigestURLSet(java.util.Vector<org.apache.commons.vfs2.FileObject> directories,
boolean subdirs,
int[] urltypes,
boolean verbose,
com.lf.commons.config.Configuration checkoptions,
java.util.Vector<com.lf.commons.io.SuffixFilter> filters,
com.lf.commons.task.BackgroundTask bgtask,
java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlcache,
long maxurlsize,
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<org.apache.commons.vfs2.FileObject> |
findBestDigests(java.util.Vector<org.apache.commons.vfs2.FileObject> 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 URLs from the caches.
|
java.util.Vector<DigestResult> |
getAllDigests(org.apache.commons.vfs2.FileObject digesturl)
Provides the digests from a certain digest URL.
|
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(org.apache.commons.vfs2.FileObject url)
Provides the best-matching digests in cache.
|
java.util.Vector<org.apache.commons.vfs2.FileObject> |
getBestDigestTargets()
Provides the target URLs for the best-matching digests in cache.
|
int |
getDigestCount(java.util.Vector<org.apache.commons.vfs2.FileObject> digesturls)
Provides the number of digests in cache (without intermediates).
|
java.util.Vector<org.apache.commons.vfs2.FileObject> |
getDigestURLs(java.io.File target)
Collects the relevant digest URLs for the given target.
|
java.util.Vector<org.apache.commons.vfs2.FileObject> |
getDigestURLs(int urltype)
Collects the digest URLs of the given type in the internal cache.
|
long |
getXMLEntrySize(org.apache.commons.vfs2.FileObject url)
Provides the URL size from the XML document.
|
long |
getXMLEntryTimestamp(org.apache.commons.vfs2.FileObject url)
Provides the URL timestamp from the XML document.
|
java.util.Vector<org.apache.commons.vfs2.FileObject> |
removeArtifacts()
Removes the digest URLs where all digests have no target.
|
java.util.Vector<org.apache.commons.vfs2.FileObject> |
removeOtherFormats(int[] urltypes)
Removes the digest URLs in other formats.
|
void |
removeTarget(org.apache.commons.vfs2.FileObject target)
Removes the results for the given ignored target.
|
protected int[] urltypes
FileResult.TYPE_GNU_SINGLE
, ...protected boolean verbose
protected com.lf.commons.task.BackgroundTask bgTask
protected java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlCache
protected long maxurlsize
protected com.lf.commons.lang.OrderedTreeMap<org.apache.commons.vfs2.FileObject,java.util.Vector<DigestResult>> cacheAllDigests
protected com.lf.commons.lang.OrderedTreeMap<org.apache.commons.vfs2.FileObject,URLResult> cacheURLResults
protected com.lf.commons.lang.OrderedTreeMap<org.apache.commons.vfs2.FileObject,java.util.Vector<DigestResult>> cacheBestDigests
public DigestURLSet() throws java.lang.InstantiationException
I18NExtractor
).
java.lang.InstantiationException
- Error indicationpublic DigestURLSet(java.util.Vector<org.apache.commons.vfs2.FileObject> directories, boolean subdirs, int[] urltypes, boolean verbose, com.lf.commons.config.Configuration checkoptions, java.util.Vector<com.lf.commons.io.SuffixFilter> filters, com.lf.commons.task.BackgroundTask bgtask, java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlcache, long maxurlsize, java.lang.String comment) throws java.lang.InterruptedException
directories
- The directories to be scanned for digest URLssubdirs
- Include sub-directories?urltypes
- The digest URLs to look for FileResult.TYPE_GNU_SINGLE
, ...verbose
- Verbose messages?checkoptions
- The values from CheckOptionsWindow
filters
- The suffix filtersbgtask
- The background task (optional)urlcache
- The cache for digest file contents (optional)maxurlsize
- The maximum size to add URLs to cachecomment
- The default commentjava.lang.InterruptedException
- If task has been cancelledprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- Error indicationpublic java.util.Vector<org.apache.commons.vfs2.FileObject> findBestDigests(java.util.Vector<org.apache.commons.vfs2.FileObject> 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 URLsalgos
- 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 int getBestDigestCount()
public int getDigestCount(java.util.Vector<org.apache.commons.vfs2.FileObject> digesturls)
digesturls
- The cachepublic java.util.Vector<DigestResult> getBestDigests()
public java.util.Vector<DigestResult> getBestDigests(org.apache.commons.vfs2.FileObject url)
url
- The desired URLpublic java.util.Vector<org.apache.commons.vfs2.FileObject> getBestDigestTargets()
public java.util.Vector<org.apache.commons.vfs2.FileObject> removeOtherFormats(int[] urltypes)
urltypes
- The desired types FileResult.TYPE_GNU_SINGLE
, ...public java.util.Vector<org.apache.commons.vfs2.FileObject> removeArtifacts()
public void debugPrint()
public java.util.Vector<org.apache.commons.vfs2.FileObject> getDigestURLs(int urltype)
urltype
- The desired type FileResult.TYPE_GNU_SINGLE
, ...public java.util.Vector<org.apache.commons.vfs2.FileObject> getDigestURLs(java.io.File target)
target
- The target URLpublic long getXMLEntrySize(org.apache.commons.vfs2.FileObject url)
url
- The target URL to checkpublic long getXMLEntryTimestamp(org.apache.commons.vfs2.FileObject url)
url
- The target URL to checkpublic java.util.Vector<DigestResult> getAllDigests(org.apache.commons.vfs2.FileObject digesturl)
digesturl
- The digest URLnull
otherwisejava.lang.NullPointerException
- If a parameter is null
public void removeTarget(org.apache.commons.vfs2.FileObject target)
target
- The ignored targetCopyright © 2005-2015 Leisenfels UG. All rights reserved.