public class Fingerprinter
extends java.lang.Object
mangler
which is used to add errors or noise to
the files being processed. This allows modification of the input dictionary on the fly, so that fingerprinters can be
tested for accuracy over errors.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
base64Fingerprint |
protected java.lang.String |
byteRun |
protected java.lang.String |
creatingProgram |
protected java.lang.String |
creator |
protected Dictionary |
dictionary |
protected java.lang.String |
diskImage |
protected java.lang.String |
fingerprintName |
protected java.lang.String |
GUID |
protected boolean |
showDataSource |
protected boolean |
showDictionary |
protected boolean |
showDigest |
protected java.lang.String |
systemID |
protected java.lang.String |
targetFile |
protected TokenizerList |
tokenizers |
protected java.util.List<java.lang.String> |
unknownTokens |
protected int |
version |
protected java.lang.String |
volume |
Constructor and Description |
---|
Fingerprinter()
Constructor that generates the fingerprint name, version, unique identifier (GUID), system identifier, and creating
program.
|
Fingerprinter(Dictionary dict)
Constructor that loads a dictionary and its tokenizers.
|
Fingerprinter(java.lang.String dictionaryFilename)
Constructor that loads a dictionary and its tokenizers.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
computeFingerprint(java.lang.String filename)
Computes the fingerprint of this document as a byte array; indicates the presence or absence of each token in this
dictionary
|
java.lang.String |
computeFingerprintXML(java.lang.String filename)
Computes the fingerprint of a document as a Base64 encoded string; indicates the presence or absence of each token
in this dictionary
|
java.lang.String |
generateCreatingProgram()
Determines the program that created this fingerprinter
|
void |
generateXML(java.lang.String base64Fingerprint,
java.lang.String document,
java.lang.String outputFile)
Generates an XML file that contains this fingerprinter's digest
|
java.lang.String |
getBase64Fingerprint()
Gives this fingerprinter's fingerprint in Base64 encoding
|
java.lang.String |
getCreatingProgram()
Gives the program that created this fingerprinter
|
Dictionary |
getDictionary()
Gives this fingerprinter's dictionary
|
java.lang.String |
getFingerprintName()
Gives this fingerprinter's name.
|
void |
loadFingerprintXML(java.lang.String fingerprintFilename)
Loads a previously generated fingerprinter digest from a fingerprint XML file.
|
void |
loadFingerprintXML(java.lang.String fingerprintFilename,
java.lang.String dictionaryFilename)
Loads a previously generated fingerprinter digest from fingerprinter and dictionary XML files.
|
void |
outputFields(java.lang.String config_file)
Sets the digest output to generate for this fingerprinter
|
void |
setCreator(java.lang.String creator)
Sets the creator (person/organization) of this fingerprinter.
|
void |
setDictionary(Dictionary dict)
Sets the dictionary for this fingerprinter.
|
void |
setDictionary(java.lang.String filename)
Sets the dictionary for this fingerprinter.
|
void |
setMangler(java.lang.String settings)
Passes the specified mangler settings to the mangler for this fingerprinter.
|
void |
setMangler(java.lang.String settings,
Dictionary dict)
Passes the specified mangler settings and a set of tokens to the mangler for this fingerprinter.
|
void |
setManglerRNG(java.util.Random random)
Sets a random number generator for the mangler to allow for repeatability.
|
void |
setOutput(boolean showDigest,
boolean showDictionary,
boolean showDataSource)
Specifies which information to display in this fingerprinter's digest XML output
|
void |
setTerse()
Sets this fingerprinter's digest XML output to only display file and fingerprint information
|
void |
setVerbose()
Sets this fingerprinter's digest XML output to display all available information
|
protected Dictionary dictionary
protected TokenizerList tokenizers
protected java.lang.String base64Fingerprint
protected java.lang.String fingerprintName
protected java.lang.String GUID
protected java.lang.String systemID
protected java.lang.String creatingProgram
protected java.lang.String creator
protected java.lang.String targetFile
protected int version
protected java.lang.String volume
protected java.lang.String diskImage
protected java.lang.String byteRun
protected java.util.List<java.lang.String> unknownTokens
protected boolean showDigest
protected boolean showDataSource
protected boolean showDictionary
public Fingerprinter()
public Fingerprinter(Dictionary dict)
dict
- the dictionary to use to create this fingerprinterpublic Fingerprinter(java.lang.String dictionaryFilename)
dictionaryFilename
- the filename containing the dictionary to use for this fingerprinterpublic void setOutput(boolean showDigest, boolean showDictionary, boolean showDataSource)
showDigest
- the boolean value specifying whether to display digest informationshowDataSource
- the boolean value specifying whether to display data source informationshowDictionary
- the boolean value specifying whether to display dictionary informationpublic void setTerse()
public void setVerbose()
public void setCreator(java.lang.String creator)
public void setMangler(java.lang.String settings)
settings
- the string of mangler settings for this fingerprinterpublic void setMangler(java.lang.String settings, Dictionary dict)
settings
- the string of mangler settings for this fingerprinterdict
- the dictionary to use to pass dictionary tokens to the manglerpublic void setManglerRNG(java.util.Random random)
random
- the random object to use for this dictionarypublic java.lang.String getFingerprintName()
public Dictionary getDictionary()
public java.lang.String getBase64Fingerprint()
public java.lang.String getCreatingProgram()
public java.lang.String generateCreatingProgram()
public byte[] computeFingerprint(java.lang.String filename)
filename
- the string filename of the document to fingerprintpublic java.lang.String computeFingerprintXML(java.lang.String filename)
filename
- the string filename of the document to fingerprintpublic void setDictionary(Dictionary dict)
dict
- the dictionary to use for this fingerprinterpublic void setDictionary(java.lang.String filename)
filename
- the string filename of the dictionary to use for this fingerprinterpublic void loadFingerprintXML(java.lang.String fingerprintFilename)
fingerprintFilename
- the string name of the XML file containing the fingerprinter's digestpublic void loadFingerprintXML(java.lang.String fingerprintFilename, java.lang.String dictionaryFilename)
fingerprintFilename
- the string name of the XML file containing the fingerprinter's digestdictionaryFilename
- the name of the XML file containing the dictionarypublic void generateXML(java.lang.String base64Fingerprint, java.lang.String document, java.lang.String outputFile)
base64Fingerprint
- the Base64 encoded string containing the fingerprintdocument
- the string filename of the document this fingerprint is foroutputFile
- the string XML filename to write the digest topublic void outputFields(java.lang.String config_file)
config_file
- the string XML filename containing the output specifications