public class DigestChecker
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector<com.lf.commons.io.SuffixFilter> |
activeFilters
The extension checker objects based on the current options.
|
protected com.lf.commons.task.BackgroundTask |
bgTask
The associated background task, may be
null . |
protected byte[] |
buffer
The buffer for file reading.
|
protected int |
calculatedCount
Number of calculated digests since targets may be ignored.
|
protected long |
calculatedLength
Overall file size processed so far.
|
protected boolean |
checkBoxBSDTarget
A checking option (required).
|
protected boolean |
checkBoxGNUTarget
A checking option (required).
|
protected boolean |
checkBoxIntermediates
A checking option (required).
|
protected boolean |
checkBoxMD2
A checking option (required).
|
protected boolean |
checkBoxMD4
A checking option (required).
|
protected boolean |
checkBoxMD5
A checking option (required).
|
protected boolean |
checkBoxMismatch
A checking option (required).
|
protected boolean |
checkBoxPGPExtension
A checking option (required).
|
protected boolean |
checkBoxPGPKeyInstall
A checking option (required).
|
protected boolean |
checkBoxRIPEMD128
A checking option (required).
|
protected boolean |
checkBoxRIPEMD160
A checking option (required).
|
protected boolean |
checkBoxRIPEMD256
A checking option (required).
|
protected boolean |
checkBoxRIPEMD320
A checking option (required).
|
protected boolean |
checkBoxSHA1
A checking option (required).
|
protected boolean |
checkBoxSHA224
A checking option (required).
|
protected boolean |
checkBoxSHA256
A checking option (required).
|
protected boolean |
checkBoxSHA384
A checking option (required).
|
protected boolean |
checkBoxSHA512
A checking option (required).
|
protected boolean |
checkBoxSubdirs
A checking option (required).
|
protected boolean |
checkBoxTiger
A checking option (required).
|
protected boolean |
checkBoxWhirlpool
A checking option (required).
|
protected boolean |
checkBoxXMLExtension
A checking option (required).
|
protected boolean |
checkBoxXMLPGP
A checking option (required).
|
protected com.lf.commons.crypto.CryptoManager |
cryptoManager
The cryptographic manager including (optional, do not work with!).
|
protected com.lf.commons.crypto.CryptoManager |
cryptoManagerWork
The cryptographic manager including temporarily loaded keys.
|
protected java.io.File[] |
digestFiles
The local entries to be checked (required).
|
protected org.apache.commons.vfs2.FileObject[] |
digestUrls
The URLs to be checked (optional).
|
protected boolean |
download
Download target URLs and check locally?
|
protected java.io.File |
downloadDir
Target directory to store download files.
|
protected boolean |
downloadOverwrite
Overwrite existing download files?
|
protected boolean |
failonerror
Stop working if an error occurs?
|
static int |
FILE_TYPE_GNU_BSD
File is a GNU/BSD file.
|
static int |
FILE_TYPE_PGP
File is a PGP signature file.
|
static int |
FILE_TYPE_UNKNOWN
File is an unknown file.
|
static int |
FILE_TYPE_XML
File is a Digester XML file.
|
protected java.util.Vector<FileResult> |
fileResults
The processed file results (do not clear!).
|
protected com.lf.commons.docking.filesys.FileSystemWindow |
fswindow
The parental component.
|
protected int |
intermediateCount
Number of intermediate digests.
|
protected int |
matchedCount
Number of matched digests.
|
static long |
MAX_URL_SIZE
Default size of digest URLs to be chached.
|
protected long |
maxurlsize
The maximum size to add URLs to cache.
|
protected int |
mismatchedCount
Number of mismatched digests.
|
protected com.lf.commons.config.Configuration |
options
The checking options from
CheckOptionsWindow (required). |
protected boolean |
radioButtonPGPKeyAsk
A checking option (required).
|
protected boolean |
radioButtonPGPKeyDownload
A checking option (required).
|
protected boolean |
radioButtonPGPKeyIgnore
A checking option (required).
|
protected com.lf.commons.docking.tabbed.TabbedWindow |
resultsWindow
The docking window for checking results.
|
protected java.lang.String[] |
standalonealgos
The algorithms to calculate for standalone target (optional).
|
protected org.apache.commons.vfs2.FileObject[] |
standaloneurls
The targets to download only (optional).
|
protected org.apache.commons.vfs2.FileObject[] |
targeturls
The targets to download only (optional).
|
protected java.lang.String |
textFieldIgnore
A checking option (required).
|
protected java.lang.String |
textFieldInclude
A checking option (required).
|
protected java.lang.String |
textFieldMD2
A checking option (required).
|
protected java.lang.String |
textFieldMD4
A checking option (required).
|
protected java.lang.String |
textFieldMD5
A checking option (required).
|
protected java.lang.String |
textFieldPGPExtension
A checking option (required).
|
protected java.lang.String |
textFieldRIPEMD128
A checking option (required).
|
protected java.lang.String |
textFieldRIPEMD160
A checking option (required).
|
protected java.lang.String |
textFieldRIPEMD256
A checking option (required).
|
protected java.lang.String |
textFieldRIPEMD320
A checking option (required).
|
protected java.lang.String |
textFieldSHA1
A checking option (required).
|
protected java.lang.String |
textFieldSHA224
A checking option (required).
|
protected java.lang.String |
textFieldSHA256
A checking option (required).
|
protected java.lang.String |
textFieldSHA384
A checking option (required).
|
protected java.lang.String |
textFieldSHA512
A checking option (required).
|
protected java.lang.String |
textFieldTiger
A checking option (required).
|
protected java.lang.String |
textFieldWhirlpool
A checking option (required).
|
protected java.lang.String |
textFieldXMLExtension
A checking option (required).
|
protected long |
totalDigestFiles
Number of digest files to be processed.
|
protected long |
totalDigestURLs
Number of digest URLs to be processed.
|
protected long |
totalLength
Overall number of bytes that must be processed (both files and URLs).
|
protected long |
totalLengthFiles
Overall file size in bytes that must be processed.
|
protected long |
totalLengthURLs
Overall URL size in bytes that must be processed.
|
protected long |
totalTargetFiles
Number of target files to be processed.
|
protected long |
totalTargetURLs
Number of target URLs to be processed.
|
protected com.lf.commons.io.TypeProvider |
typeProvider
Determines the icons to use for URLs.
|
protected java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> |
urlcache
The cache for digest file contents (optional).
|
protected java.util.Vector<URLResult> |
urlResults
The processed URL results (do not clear!).
|
protected boolean |
verbose
Create verbose messages?
|
protected com.lf.commons.docking.vfs.VFSSessionWindow |
vfswindow
The parental component.
|
Constructor and Description |
---|
DigestChecker()
The constructor method for the checker.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
accept(java.lang.String extensions,
java.lang.String suffix)
Determines whether the given defined extensions apply to the given suffix.
|
org.apache.commons.vfs2.FileObject[] |
analyzeDigestURL(org.apache.commons.vfs2.FileObject digesturl)
Reads the given digest URL according to its extension and provides the contained target URLs.
|
static com.lf.commons.task.BackgroundTask |
createBackgroundTask(javax.swing.Icon icon,
java.io.File[] digestfiles,
com.lf.commons.config.Configuration options,
com.lf.commons.docking.tabbed.TabbedWindow results,
com.lf.commons.docking.filesys.FileSystemWindow fswindow,
boolean logmessages,
boolean failonerror,
org.apache.commons.vfs2.FileObject[] digesturls,
com.lf.commons.io.TypeProvider provider,
org.apache.commons.vfs2.FileObject[] targeturls,
com.lf.commons.docking.vfs.VFSSessionWindow vfswindow,
org.apache.commons.vfs2.FileObject[] standaloneurls,
java.lang.String[] standalonealgos,
java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlcache,
long maxurlsize,
boolean download,
java.io.File downloaddir,
boolean overwrite,
com.lf.commons.crypto.CryptoManager cryptomanager)
Convenience method to get a pre-configured background task (maybe download, then check).
|
static DigestChecker |
createChecker(java.io.File[] digestfiles,
com.lf.commons.config.Configuration options,
com.lf.commons.docking.tabbed.TabbedWindow results,
com.lf.commons.docking.filesys.FileSystemWindow fswindow,
com.lf.commons.docking.vfs.VFSSessionWindow vfswindow,
boolean failonerror,
org.apache.commons.vfs2.FileObject[] digesturls,
com.lf.commons.io.TypeProvider provider,
java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlcache,
long maxurlsize,
com.lf.commons.crypto.CryptoManager cryptomanager)
Convenience method to get a pre-configured checker instance (find digest URLs).
|
protected void |
finalize()
Clean-up method to help the gc.
|
int |
getCheckedTargetCount()
Provides the number of successfully checked target files/URLs.
|
void |
run()
Execution code.
|
public static final int FILE_TYPE_XML
public static final int FILE_TYPE_GNU_BSD
public static final int FILE_TYPE_PGP
public static final int FILE_TYPE_UNKNOWN
public static final long MAX_URL_SIZE
protected com.lf.commons.task.BackgroundTask bgTask
null
.protected java.io.File[] digestFiles
protected org.apache.commons.vfs2.FileObject[] digestUrls
protected com.lf.commons.config.Configuration options
CheckOptionsWindow
(required).protected com.lf.commons.docking.tabbed.TabbedWindow resultsWindow
protected java.util.Vector<com.lf.commons.io.SuffixFilter> activeFilters
protected boolean verbose
protected boolean failonerror
protected com.lf.commons.docking.filesys.FileSystemWindow fswindow
protected com.lf.commons.docking.vfs.VFSSessionWindow vfswindow
protected int calculatedCount
protected int intermediateCount
protected long totalLengthFiles
protected long totalLengthURLs
protected long totalLength
protected long totalDigestFiles
protected long totalDigestURLs
protected long totalTargetFiles
protected long totalTargetURLs
protected long calculatedLength
protected byte[] buffer
protected int matchedCount
protected int mismatchedCount
protected com.lf.commons.io.TypeProvider typeProvider
protected org.apache.commons.vfs2.FileObject[] targeturls
protected org.apache.commons.vfs2.FileObject[] standaloneurls
protected java.lang.String[] standalonealgos
protected java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlcache
protected long maxurlsize
protected boolean checkBoxXMLExtension
protected boolean checkBoxPGPExtension
protected boolean checkBoxMD2
protected boolean checkBoxMD4
protected boolean checkBoxMD5
protected boolean checkBoxRIPEMD128
protected boolean checkBoxRIPEMD160
protected boolean checkBoxRIPEMD256
protected boolean checkBoxRIPEMD320
protected boolean checkBoxSHA1
protected boolean checkBoxSHA224
protected boolean checkBoxSHA256
protected boolean checkBoxSHA384
protected boolean checkBoxSHA512
protected boolean checkBoxTiger
protected boolean checkBoxWhirlpool
protected java.lang.String textFieldXMLExtension
protected java.lang.String textFieldPGPExtension
protected java.lang.String textFieldMD2
protected java.lang.String textFieldMD4
protected java.lang.String textFieldMD5
protected java.lang.String textFieldRIPEMD128
protected java.lang.String textFieldRIPEMD160
protected java.lang.String textFieldRIPEMD256
protected java.lang.String textFieldRIPEMD320
protected java.lang.String textFieldSHA1
protected java.lang.String textFieldSHA224
protected java.lang.String textFieldSHA256
protected java.lang.String textFieldSHA384
protected java.lang.String textFieldSHA512
protected java.lang.String textFieldTiger
protected java.lang.String textFieldWhirlpool
protected boolean checkBoxGNUTarget
protected boolean checkBoxBSDTarget
protected boolean checkBoxXMLPGP
protected boolean checkBoxIntermediates
protected boolean checkBoxMismatch
protected boolean radioButtonPGPKeyAsk
protected boolean radioButtonPGPKeyIgnore
protected boolean radioButtonPGPKeyDownload
protected boolean checkBoxPGPKeyInstall
protected java.lang.String textFieldInclude
protected java.lang.String textFieldIgnore
protected boolean checkBoxSubdirs
protected boolean download
protected java.io.File downloadDir
protected boolean downloadOverwrite
protected com.lf.commons.crypto.CryptoManager cryptoManager
protected com.lf.commons.crypto.CryptoManager cryptoManagerWork
protected java.util.Vector<FileResult> fileResults
protected java.util.Vector<URLResult> urlResults
public DigestChecker()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- Error indicationpublic void run()
run
in interface java.lang.Runnable
public static boolean accept(java.lang.String extensions, java.lang.String suffix)
extensions
- The defined suffixessuffix
- The suffix to be checkedpublic org.apache.commons.vfs2.FileObject[] analyzeDigestURL(org.apache.commons.vfs2.FileObject digesturl)
digesturl
- The digest URL to be readpublic int getCheckedTargetCount()
public static DigestChecker createChecker(java.io.File[] digestfiles, com.lf.commons.config.Configuration options, com.lf.commons.docking.tabbed.TabbedWindow results, com.lf.commons.docking.filesys.FileSystemWindow fswindow, com.lf.commons.docking.vfs.VFSSessionWindow vfswindow, boolean failonerror, org.apache.commons.vfs2.FileObject[] digesturls, com.lf.commons.io.TypeProvider provider, java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlcache, long maxurlsize, com.lf.commons.crypto.CryptoManager cryptomanager)
digestfiles
- The target files to be checkedoptions
- The check options from CheckOptionsWindow
results
- The docking window for checking resultsfswindow
- The parental componentvfswindow
- The parental component (optional)failonerror
- Stop on errors (Ant task)?digesturls
- The URLs to be checkedprovider
- The URL type provider (optional)urlcache
- The cache for digest file contents (optional)maxurlsize
- The maximum size for URLs to be cachedcryptomanager
- The crypto manager for PGP signatures (optional)public static com.lf.commons.task.BackgroundTask createBackgroundTask(javax.swing.Icon icon, java.io.File[] digestfiles, com.lf.commons.config.Configuration options, com.lf.commons.docking.tabbed.TabbedWindow results, com.lf.commons.docking.filesys.FileSystemWindow fswindow, boolean logmessages, boolean failonerror, org.apache.commons.vfs2.FileObject[] digesturls, com.lf.commons.io.TypeProvider provider, org.apache.commons.vfs2.FileObject[] targeturls, com.lf.commons.docking.vfs.VFSSessionWindow vfswindow, org.apache.commons.vfs2.FileObject[] standaloneurls, java.lang.String[] standalonealgos, java.util.TreeMap<org.apache.commons.vfs2.FileObject,byte[]> urlcache, long maxurlsize, boolean download, java.io.File downloaddir, boolean overwrite, com.lf.commons.crypto.CryptoManager cryptomanager)
icon
- The icon representing the taskdigestfiles
- The target files to be checkedoptions
- The check options from CheckOptionsWindow
results
- The docking window for checking resultsfswindow
- The parental componentlogmessages
- Shall messages be logged sequentially (optional)?failonerror
- Stop on errors (Ant task)?digesturls
- The URLs to be checkedvfswindow
- The parental component (optional)provider
- The URL type provider (optional)targeturls
- The targets associated with digest filesstandaloneurls
- The targets to download and calculate only (no check, optional)standalonealgos
- The algorithms to calculate for standalone targets (optional)urlcache
- The cache for digest file contents (optional)maxurlsize
- The maximum size for URLs to be cacheddownload
- Download URLs and check locally? Check URLs directly otherwise.downloaddir
- Target directory to store download filesoverwrite
- Overwrite existing download files?cryptomanager
- The crypto manager for PGP signatures (optional)Copyright © 2005-2015 Leisenfels UG. All rights reserved.