input
stringlengths
10
828
output
stringlengths
5
107
public void register string public id url entity url if log is debug enabled log debug register public id entity url entity validator put public id entity url
p register the specified dtd url for the specified public identifier
public void register string public id string entity url if log is debug enabled log debug register public id entity url try entity validator put public id new url entity url catch malformed urlexception e throw new illegal argument exception malformed url entity url e get message
p convenience method that registers the string version of an entity url
public void clear match body texts clear params clear public id null stack clear stacks by name clear custom content handler null
clear the current contents of the default object stack the param stack
public object pop try object popped stack pop if stack action null popped stack action on pop this null popped return popped catch empty stack exception e log warn empty stack returning null return null
pop the top object off of the stack and return it
public void push object object if stack action null object stack action on push this null object if stack size 0 root object stack push object
push a new object onto the top of the object stack
public void push string stack name object value if stack action null value stack action on push this stack name value array stack named stack array stack stacks by name get stack name if named stack null named stack new array stack stacks by name put stack name named stack named stack push value
pushes the given object onto the stack with the given name
public object peek string stack name return peek stack name 0
p gets the top object from the stack with the given name
public object peek string stack name int n object result null array stack named stack array stack stacks by name get stack name if named stack null if log is debug enabled log debug stack stack name is empty throw new empty stack exception else result named stack peek n return result
p gets the top object from the stack with the given name
protected void cleanup if we created any input source objects in this instance they each have an input stream that should be closed iterator sources input sources iterator while sources has next input source source input source sources next try source get byte stream close catch ioexception e fall through so we get them all
p clean up allocated resources after parsing is complete
public saxexception create saxexception string message exception e if e null e instanceof invocation target exception throwable t invocation target exception e get target exception if t null t instanceof exception e exception t if locator null string error error at line locator get line number char locator get column number message if e null return new saxparse exception error locator e else return new saxparse exception error locator log error no locator if e null return new saxexception message e else return new saxexception message
create a sax exception which also understands about the location in
public void initialize email notification configuration configuration email notification configuration configuration manager retrieve configuration configuration names email configuration if configuration null configuration new email notification configuration configuration set disabled boolean true configuration set id configuration names email configuration configuration manager create configuration configuration
checks if there is an email configuration and creates a default one if
public void set subject extractors list subject extractors subject extractor map new hash map class subject extractor iterator subject extractor subject extractor iter subject extractors iterator while subject extractor iter has next subject extractor subject extractor subject extractor subject extractor iter next subject extractor map put subject extractor get handled class subject extractor
constructs a map of values based upon the value of
public void set format short renderers list format short renderer format short renderers format short renderer map new hash map class format short renderer iterator format short renderer format short renderer iter format short renderers iterator while format short renderer iter has next format short renderer format short renderer format short renderer format short renderer iter next format short renderer map put format short renderer retrieve class handled format short renderer
constructs a map of values based upon the value of
public void remove empty extensions list extension extensions list extension extensions copy new array list extension extensions iterator extension extension iter extensions iterator for int index 0 extension iter has next index extension extension extension iter next if extension get extension null extension get extension matches extension get extension matches s extension iter remove extensions remove index
this method is a little confusing we scan through the extensions list
public repository risk summary dto retrieve collection risk summary dto long collection id repository collection collection repository manager retrieve collection collection id list aggregate identification metadata pair pairs collection get pairs list base format risk summary dto format risk summaries retrieve format risk summaries pairs repository risk summary dto repository risk summary dto new repository risk summary dto repository risk summary dto set date null repository risk summary dto set collection path info repository manager retrieve collection path info collection get id repository risk summary dto set format risk summaries format risk summaries return repository risk summary dto
retrieves a risk summary for a collection a subset of a repository
public list get specific registry format utils return new array list specific registry format util specific registry format util map values
constructs a list from the underlying map of values
public void update with value format property value format property value format property digest context context if value format property null update with string value format property get readable key context update with string value format property get search value context
updates the digest with the specified value format property
public void update with key format property key format property key format property digest context context if key format property null update with string key format property get readable key context
updates the digest with the specified key format property
public void update with string string value digest context context if value null long size value length context set bytes written context get bytes written size message digest digest context get digest digest update value get bytes
updates the digest with the specified string
public list get relationship handlers return new array list relationship handler map values
constructs a list from the underlying map of values
public void set relationship handlers list relationship handlers relationship handler map new hash map iterator relationship handler iter relationship handlers iterator while relationship handler iter has next relationship handler relationship handler relationship handler relationship handler iter next relationship handler map put relationship handler get lc dfw relationship relationship handler
constructs a map of values based upon the value of
public void set registry synchronize schedule workers list registry synchronize schedule workers registry synchronize schedule worker map new hash map string registry synchronize schedule worker iterator registry synchronize schedule worker registry synchronize schedule worker iter registry synchronize schedule workers iterator while registry synchronize schedule worker iter has next registry synchronize schedule worker registry synchronize schedule worker registry synchronize schedule worker registry synchronize schedule worker iter next registry synchronize schedule worker map put registry synchronize schedule worker get registry type registry synchronize schedule worker
constructs a map of values based upon the value of
private string strip html string in return in replace all replace all
strips out all tags and entities
public void set idstatus int the status my idstatus the status
set the file identification status
public void set warning string warning identification warning warning
set the file identification warning
public void add hit ffit file format hit hit file hits add hit
add a file format hit for this file
public void set file name string the file name my file name the file name
specify the file path for where to store the file list
public void add file format hit file format hit the hit file hits add the hit
add a file format hit for this file
public void remove hit int index file hits remove index
remove a file format hit for the file
public string get file name if input stream byte reader is input stream file path return input stream has no file name else if url byte reader is url file path file part of url return url byte reader get url file path get file else return new java io file file path get name
returns the file name without the full path
private boolean is duplicate string the file name for int i 0 i my files size i if this get file i get file path equals ignore case the file name return true return false
checks whether the file already exists in file collection
public void set file string the file this add file the file false
add a single file or folder to the collection
public void remove file string the file name for int i 0 i this get num files i if this get file i get file path equals the file name this remove file i
remove file from the file list
public boolean has matching extension string the extension boolean matching extension false for int i extension 0 i extension this get num extensions i extension if the extension equals ignore case this get extension i extension matching extension true loop through extensions return matching extension
indicates whether the file extension given is valid for this file format
public void remove file int the file index if the file index my files size my files remove the file index
remove file from the file list
public void remove all my files clear
empty file list
public void complete element content string the element value this get text simple element this get text try this my shift value long parse long the element value catch exception e message display general warning the following non numerical shift distance was found in the signature file the element value this my shift value 1
set the shift distance when the end of element tag is reached
public void set attribute value string the name string the value if the name equals byte try my shift byte integer parse int the value 16 catch exception e else message display unknown attribute warning the name this get element name
respond to an xml attribute
public identification file get file string the file name for int i 0 i this get num files i if this get file i get file path equals the file name return this get file i return null
remove file from the file list
public void set attribute value string the name string the value if the name equals ffit analysis controller label application version set droidversion the value else if the name equals sig file version set signature file version the value else if the name equals ffit analysis controller label date created set date created the value else message display unknown attribute warning the name this get element name
populates the details of the file collection when read in from xml file
public int get loaded file sig file version return my sig file version
returns the signature file version recorded in the file collection file
public boolean is file compliant byte reader target file initialise variable boolean is compliant true check each byte sequence in turn stop as soon as one is found to be non compliant for int i 0 i this byte sequences size is compliant i is compliant this get byte sequence i is file compliant target file return is compliant
indicates whether the file is compliant with this internal signature
private void reorder all sequence fragments for int i sig 0 i sig this get num internal signatures i sig for int i bs 0 i bs this get internal signature i sig get num byte sequences i bs for int i ss 0 i ss this get internal signature i sig get byte sequence i bs get num sub sequences i ss this get internal signature i sig get byte sequence i bs get sub sequence i ss prepare seq fragments
run prepare seq fragments on all sub sequences within all byte sequences
public void complete element content
method to be overridden in cases where the element content needs to be
public string get hit type verbose string the hit type if my hit type analysis controller hit type positive generic the hit type analysis controller hit type positive generic text else if my hit type analysis controller hit type positive specific the hit type analysis controller hit type positive specific text else if my hit type analysis controller hit type tentative the hit type analysis controller hit type tentative text else if my hit type analysis controller hit type positive generic or specific the hit type analysis controller hit type positive generic or specific text return the hit type
get the name of the hit type
private void read input stream try read stream system in catch ioexception ex this set error ident this set identification warning input stream could not be read
read data into buffer or temporary file from the code system
public boolean is specific if my hit type analysis controller hit type positive specific return true else return false
for positive hits this returns true if hit is specific
public void set file marker long marker position if marker position 1 l marker position this get num bytes throw new illegal argument exception unable to place a file marker at byte long to string marker position in file this my idfile get file path size long to string this get num bytes bytes else this file marker marker position
position the file marker at a given byte position
public void set name string value if necessary this creates a new dummy file format if my hit file format null my hit file format new file format my hit file format set attribute value name value
set hit format name
public void set version string value if my hit file format null my hit file format new file format my hit file format set attribute value version value
set hit format version
public void set puid string value if my hit file format null my hit file format new file format my hit file format set attribute value puid value
set hit format puid
public byte get byte long file index return buffer get int file index
get a byte from file
public long get file marker return buffer position
gets the current position of the file marker
public long get num bytes return buffer null 0 buffer limit
returns the number of bytes in the file
public long get num bytes return my num bytes
returns the number of bytes in the file
public void set file marker long marker position buffer position int marker position
position the file marker at a given byte position
private string show byte byte the byte string byte display byte display integer to hex string the byte if byte display length 1 byte display 0 byte display if byte display length 2 byte display byte display substring byte display length 2 return byte display
displays a byte in the same format as used by tna
public void read configuration throws exception read configuration config file name use default file name
reads the default configuration file and loads the contents into memory
public void save configuration throws ioexception my config file save configuration
saves the current configuration to the default file name
public void save configuration string file path throws ioexception my config file set file name file path my config file save configuration
saves the current configuration to file in xml format
public void read file collection throws exception read file collection file list file name use default file name
read in the default file collection file
public void read sig file string the sig file name throws exception read sig file the sig file name true
reads in and parses the signature file
public void read sig file string the sig file name boolean is config save throws exception read sig file the sig file name is config save false
reads and parses the signature file
public ffsignature file parse sig file string the file name throws exception saxparser factory factory saxparser factory new instance factory set namespace aware true saxparser sax parser factory new saxparser xmlreader parser sax parser get xmlreader saxmodel builder mb new saxmodel builder mb setup namespace signature file ns true parser set content handler mb read in the xml file java io buffered reader in new java io buffered reader new java io input stream reader new java io file input stream the file name utf8 parser parse new input source in return ffsignature file mb get model
create a new signature file object based on a signature file
public void add file string file folder name add file file folder name false
add files to list of files ready for identification
public void add file string file folder name boolean is recursive my file collection add file file folder name is recursive
add file to list of files ready for identification
public void remove file string the file name my file collection remove file the file name
remove file from the file list
public identification file get file int the index identification file the file null try the file my file collection get file the index return my file collection get file the index catch exception e return the file
returns an identification file object based on its index in the list
public int get num files int the num files 0 try the num files my file collection get num files catch exception e return the num files return my file collection get num files
returns the number of files in identification file list
public int get sig file version int the version 0 try the version integer parse int my sig file get version catch exception e return the version return integer parse int my sig file get version
return the version of the currently loaded signature file
public string get proxy host return my config file get proxy host
return the current proxy host setting
public void set proxy host string value my config file set proxy host value
set the proxy host
public int get proxy port return my config file get proxy port
return the current proxy port setting
public void set proxy port int value my config file set proxy port integer to string value
set the proxy port number
public int get num completed files if is analysis running return my num completed files else int the num completed files 0 for int i 0 i get num files i if my file collection get file i is classified the num completed files return the num completed files
returns the number of files that have been analysed
public boolean is analysis complete return is analysis running
checks whether analysis has finished yet
public void set analysis start my num completed files 0 is analysis running true
record start of anlaysis
public void incr num completed file my num completed files
records the fact that a file has been anlaysed
public boolean is analysis cancelled return my analysis cancelled
checks whether analysis has been cancelled by the user
public void cancel analysis my analysis cancelled true
cancel the analysis
public void run file format analysis my analysis cancelled false my out file name my out formats new analysis thread my file collection my sig file this start
launch the analysis thread on the files that have been listed and using
public void run file format analysis string the out formats string the out file name my analysis cancelled false my out file name the out file name my out formats the out formats new analysis thread my file collection my sig file this start
launch the analysis thread on the files that have been listed and using
public file collection get file collection return my file collection
access to the file collection
public boolean is sig file download due return my config file is download due
checks whether a new signature file download is due
public string get signature file name return my config file get sig file name
returns the file path of the signature file
public void set sig file check freq string the freq my config file set sig file check freq the freq
updates the configuration parameter which records the interval after which
protected void close dialog if m custom editor instanceof container dialog dlg property dialog get parent dialog container m custom editor if dlg null dlg set visible false
closes the dialog
protected component create custom editor jpanel panel panel new jpanel new border layout panel set border border factory create empty border 5 5 5 5 m edit component class option edit component class option get value get edit component m edit component add change listener new change listener public void state changed change event e m edit component apply state set value m edit component get edited option panel add m edit component border layout center return panel
creates the custom editor
public component get custom editor if m custom editor null m custom editor create custom editor return m custom editor
gets the custom editor component
public void paint value graphics gfx rectangle box font metrics fm int vpad string val fm gfx get font metrics vpad box height fm get height 2 val class option get value get value as clistring gfx draw string val 2 fm get height vpad
paints a representation of the current object
public string global info return a wrapper around moa instance streams
returns a string describing this data generator
public enumeration list options vector result enum to vector super list options result add new option t the moa stream generator n t default moautils to command line new ledgenerator b 1 b classname options return result elements
returns an enumeration describing the available options
public string global info return wrapper for moa classifiers n n since moa doesn t offer a mechanism to query a classifier for the types of attributes and classes it can handle the capabilities of this wrapper are hard coded nominal and numeric attributes and only nominal class attributes are allowed
returns a string describing the classifier
public void set options string options throws exception string tmp str class option option tmp str utils get option b options option class option m generator copy if tmp str length 0 option set current object new ledgenerator else option set current object moautils from command line m generator tmp str set generator option super set options options
parses a list of options for this object
public void set generator class option value m generator value m actual generator instance stream moautils from option m generator
sets the moa stream generator to use
public enumeration list options vector result new vector result add element new option t the moa classifier to use n t default moautils to command line new decision stump b 1 b classname options enumeration en super list options while en has more elements result add element en next element return result elements
returns an enumeration describing the available options
public class option get generator return m generator
returns the current moa stream generator in use
public void set options string options throws exception string tmp str class option option tmp str utils get option b options option class option m classifier copy if tmp str length 0 option set current object new decision stump else option set current object moautils from command line m classifier tmp str set classifier option super set options options
parses a given list of options
public void set classifier class option value m classifier value m actual classifier classifier moautils from option m classifier
sets the moa classifier to use
public string generator tip text return the moa stream generator to use
returns the tooltip displayed in the gui