input
stringlengths
10
828
output
stringlengths
5
107
public int get match type return 0
return flags indicating what it was about the input data
public string get name return f recognizer get name
get the name of the detected charset
public charset detector set text byte in f raw input in f raw length in length munge input return this
set the input text byte data whose charset is to be detected
public string get property with substitutions string property return str substitutor replace system properties get property property
gets the property value replacing all variable references
public string get language return f recognizer get language
get the iso code for the language of the detected charset
public int compare to object o charset match other charset match o int compare result 0 if this f confidence other f confidence compare result 1 else if this f confidence other f confidence compare result 1 return compare result
compare to other charset match objects
public collection get logging files collection string result new array list string list list xml get all child appender iterator iter list iterator while iter has next element elem element iter next list childs elem get children param iterator children childs iterator while children has next element child element children next if child get attribute value name equals file result add elem get attribute value name return result
this method selects all file appenders
public string get file string appender boolean replace variables string result element elem xml get child appender name appender list childs elem get children param iterator children childs iterator while children has next element child element children next if child get attribute value name equals file result child get attribute value value if replace variables result str substitutor replace system properties result return result
this method selects a filepath of an appender
public element get root element return root
returns the root element
public void set file string appender string file element elem xml get child appender name appender list childs elem get children param iterator children childs iterator while children has next element child element children next if child get attribute value name equals file child set attribute value file
this method sets a file of an appender
public charset match detect a better implementation would be to copy the detect loop from detect all and cut it short as soon as a match with a high confidence is found this is something to be done later after things are otherwise working charset match matches detect all if matches null matches length 0 return null return matches 0
return the charset that best matches the supplied input data
public element get child string elemname if doc null return null else return root get child elemname
returns a child element
public element get child string elemname string attribute string value if doc null return null else element temp null list list root get children elemname iterator iter list iterator string val while iter has next element elem element iter next val elem get attribute value attribute if val null val equals value temp elem break return temp
this method finds a child by name and attribute
public string get text element elem if doc null return null else return elem get text
this returns the text between a begining and an ending tag
public reader get reader input stream in string declared encoding f declared encoding declared encoding try set text in charset match match detect if match null return null return match get reader catch ioexception e return null
autodetect the charset of an input stream and return a java reader
public string get child text string elemname string childname string attribute string value element elem get child elemname attribute value elem elem get child childname return get text elem
this method returns the text of a child element characterized by
public void set logs root string root path list list xml get all child appender iterator iter list iterator while iter has next element elem element iter next list childs elem get children param iterator children childs iterator while children has next element child element children next if child get attribute value name equals file string file child get attribute value value file filename utils concat root path filename utils get name file child get attribute value set value file replace all
sets a common path for all file appenders
public string get all child text string elemname string attribute string value string separator1 string separator2 string result try element elem get child elemname attribute value list list elem get children iterator iter list iterator while iter has next element child element iter next result child get name result separator1 result child get text result separator2 catch exception ex log error ex get message ex ex print stack trace return result
this method returns the text of all children in the format
public void add servlet string name string clazz this add servlet name clazz 1
adds a new servlet mapping to the deployment descriptor
public attribute get attribute element elem string attrib if doc null return null else return elem get attribute attrib
returns an elementattribute
public string get attribute value element elem string attrib if doc null return null else return elem get attribute value attrib
returns the value of an elementattribute
public void set attribute value element elem string attrib string value elem get attribute attrib set value value
this method set the value of an elementattribute
public string get property prop string id string property name string key element element get prop element id property name key if element null return element get text return null
retrieves the prop value of the specified property that is one inside
protected element get prop element string id string property name string key element element get property element id property name element props element get child props for iterator iter props get children iterator iter has next element prop element iter next if key equals prop get attribute value key return prop return null
retrieves the prop element of the specified property that is one inside
public list get root child if doc null return null else return root get children
this method returns all direct children of the root element
public void set prop value string id string property name string key string value element prop get prop element id property name key if prop null prop set text value
sets the prop value of the specified property that is one inside the
public list get all attribute element elem if doc null return null else return elem get attributes
returns a list of all attributes from an element
public list get all child string elemname if doc null return null else return root get children elemname
returns a list of all elements with the given elementname
public list get all child string elemname string attribute string value list element list new linked list element list elems root get children elemname iterator iter elems iterator while iter has next element elem element iter next try string val elem get attribute value attribute if val null val equals value list add elem catch exception e return list
returns a list of all children with the specific name and the specific
public boolean remove child string elemname return root remove child elemname
removes an element
public void add trigger string trigger id element element get property element scheduler triggers element list element get child list list refs list get children ref for iterator iterator refs iterator iterator has next element ref element iterator next if trigger id equals ref get attribute bean get value return element ref new element ref list get namespace ref set attribute bean trigger id list add content ref xml write xmldoc
enlists a new trigger in the scheduler
public void execute try do connection for string sql sql list try execute sql catch exception e log error failed to execute sql e catch throwable e log error e get message e try if con null con close catch sqlexception e1 e1 print stack trace
executes all the sql files defined in the constructor
public void execute sql string sql try do connection prepared statement st con prepare statement sql st execute st close catch throwable e log error e get message e log error failed to execute sql e try if con null con close catch sqlexception e1 e1 print stack trace
execute a sql statements in the passed string
private void execute string sql file throws ioexception sqlexception log debug execute sql file system out println execute sql file file file new file sql file if file exists file can read file file create temp file file get name sql file delete on exit file util copy resource sql file file sql file s file new sql file file cp1252 false try s file set continue on error true s file set connection con s file execute catch sql tool error e throw new sqlexception e get message
executes a single sql file
public boolean is connected try return con is closed catch exception ex log debug db connection is open ex get message ex return false
this method returns the state of the connection
public boolean test connection boolean result false try class for name driver con driver manager get connection url username password result true con close catch exception ex log error ex get message ex return result
this method tests a connection
public void close throws ioexception out flush out close
close the output csv file
public void set field separator char sep field separator sep
set the current field separator
public void set text qualifier char qual text qualifier qual
set the current text qualifier
public char get field separator return field separator
get the current field separator
protected int handle quoted field string s string buffer sb int i int j int len s length for j i j len j if s char at j text qualifier j 1 len if s char at j 1 text qualifier j skip escape char else if s char at j 1 field separator next delimiter j skip end quotes break else if s char at j text qualifier j 1 len end quotes at end of line break done sb append s char at j regular character return j
handles a quoted field
public char get text qualifier return text qualifier
get the current text qualifier
protected int handle plain field string s string buffer sb int i int j s index of field separator i look for separator if j 1 none found sb append s substring i return s length else sb append s substring i j return j
handles an unquoted field
private file get install mark return new file resolve data path install to string
return the install mark file that is the file called install inside
protected boolean is install needed return get install mark exists
tells is the plug in need to be installed
public string get plugin path string path get manager get path resolver resolve path get descriptor to string if path starts with jar file path path substring jar file length path path substring 0 path last index of try the path may contain url encoded sequences path urldecoder decode path utf 8 catch unsupported encoding exception e return path
retrieves the path of the plugin jar archive
public file resolve data path string relative path return new file get data directory relative path
resolves a relative path inside the plugin data folder
public file get data directory string plugin name get descriptor get unique id substring 0 get descriptor get unique id last index of return plugin registry get plugin home plugin name
returns the data directory for this plugin that is
protected void install throws exception
concrete implementations of this method must insert first installation
protected void start throws exception
concrete implementations of this method must insert startup
public plugin descriptor get plugin string plugin id plugin registry registry plugin registry get instance return registry get manager get registry get plugin descriptor plugin id
retrieve the plugin descriptor
public void do post http servlet request request http servlet response response throws servlet exception ioexception response set content type text html print writer out response get writer out println doctype html public w3 c dtd html 4 01 transitional en out println html out println head title download ticket action title head out println body out print this is out print this get class out println using the post method out println body out println html out flush out close
the do post method of the servlet
private void unpack plugins servlet context context throws ioexception file plugins dir plugin registry get plugins dir file archives plugins dir list files new filename filter override public boolean accept file dir string name if name contains plugin return true else return false file webapp dir new file context get real path if archives null for file archive archives system out println unpack plugin archive get name zip util unzip archive get path webapp dir get path file utils force delete archive need restart true
unpacks the plugin that are newly installed and positioned in the plugins
public void set location info boolean flag location info flag
the b location info b option takes a boolean value
public boolean get location info return location info
returns the current value of the b location info b option
public string get content type return text html
returns the content type output by this layout i
public void activate options
no options to activate
public string get footer string buffer sbuf new string buffer sbuf append table layout line sep sbuf append br layout line sep sbuf append body html return sbuf to string
returns the appropriate html footers
public boolean ignores throwable return false
the html layout handles the throwable contained in logging events
public void do post http servlet request request http servlet response response throws servlet exception ioexception response set content type text html print writer out response get writer out println doctype html public w3 c dtd html 4 01 transitional en out println html out println head title download document servlet title head out println body out print this is out print this get class out println using the post method out println body out println html out flush out close
the do post method of the servlet
private void destroy database assert assert not null ds connection con null try con ds get connection con create statement execute shutdown immediately catch exception e e print stack trace finally try if con null con close catch exception ex ex print stack trace
destroys the in memory database
private void list folders recursive server proxy server proxy long parent folder wsfolder folders new wsfolder 0 try folders server proxy folder client list children server proxy sid parent folder catch exception e log warn list folders recursive e if folders null total folders folders length for wsfolder info folders list folders recursive server proxy info get id
recursive method to list all folders in the hierarchy
public void set stop must stop set true
notify the running thread to exit at the first available opportunity
public void init throws exception loaders make threads session log the initial summaries string summary session get summary session log summary summary header the outputs session log summary load session get line ending session log summary columns summary initialize control console init console
initializes resources and connects to the web service
public string get workflow name workflow service workflow service workflow service context get instance get bean workflow service workflow instance workflow instance workflow service get workflow instance by task instance id fetch type info if workflow instance null return workflow instance get name else return
the name of the workflow to which the current task instance belongs
private file get templates directory file file new file try logical docplugin workflow plugin logical docplugin plugin registry get instance get manager get plugin logicaldoc workflow file workflow plugin resolve data path templates if file exists file mkdir catch throwable t log error t get message t return file
computes the directory in which all jbpm files must be maintained that
public string get title return get document get title
gets the description of the record
public boolean is linked document dao doc dao document dao context get instance get bean document dao class return doc dao find linked documents get doc id null null size 0
checks if this document has links or is linked
protected void load document document dao doc dao document dao context get instance get bean document dao class this document doc dao find by id doc id if this document null this document get deleted 1 this document new document else if this document get doc ref null this document is a shortcut so load the referenced doc this shortcut document this document doc dao find by id document get doc ref if this document null this document new document
utility method used by document lazy loading
private void destroy database connection con null try con ds get connection con create statement execute shutdown catch exception e try if con null con close catch exception ex e print stack trace
destroys the in memory database
public void set user base string string user base string string tokenizer st new string tokenizer user base string false user base clear while st has more tokens user base add st next token
the user base list each element separated by a semi colon
public void set group base string string group base string string tokenizer st new string tokenizer group base string false group base clear while st has more tokens group base add st next token
the group base list each element separated by a semi colon
public email cache get cache email account account throws ioexception file cache file new file get cache directory cache account get id txt return new email cache cache file
retrieves the cache for the specified email
private file get cache directory file file new file try logical docplugin email plugin logical docplugin plugin registry get instance get manager get plugin logicaldoc email file email plugin resolve data path cache if file exists file mkdir catch throwable t log error t get message t return file
computes the directory in which all cache files must be maintained that
public boolean is allowed string type string tokenizer st new string tokenizer allowed types false while st has more tokens if st next token equals ignore case type return true return false
check if the specified type is allowed or not
private void destroy database connection con null try con ds get connection con create statement execute shutdown immediately catch exception e e print stack trace finally try if con null con close catch exception ex ex print stack trace
destroys the in memory database
private int count mails email account account throws messaging exception int count 0 store store null folder inbox null try session session session get instance new properties store session get store account get provider store connect account get host account get port account get user name account get password inbox store get folder inbox inbox open folder read only count inbox get message count finally if inbox null inbox close true if store null store close return count
count all mails from the specified account
public list list views throws dbengine exception return new array list
returns a list of views accessible to the user
public string get sqlfor view string view name throws dbengine exception return
returns the sql used to create a view
public void action performed java awt event action event evt if evt get action command equals wizard cancel button action command cancel button pressed else if evt get action command equals wizard back button action command back button pressed else if evt get action command equals wizard next button action command next button pressed
calling method for the action listener interface
private void init document syntax lexer new sqllexer document reader try document insert string document get length get style text catch bad location exception ble system err println couldn t insert initial text
initialize the document with some default text and set
public long get inventory id return inventory id
getter of the property tt inventory id tt
public void set inventory id long inventory id this inventory id inventory id
setter of the property tt inventory id tt
public set get resource container return resource container
getter of the property tt resource container tt
public void set resource container set resource container this resource container resource container
setter of the property tt resource container tt
public set get project component return project component
getter of the property tt project component tt
public void set project component set project component this project component project component
setter of the property tt project component tt
public set get filiais return filiais
getter of the property tt filial tt
public void set filiais set filial this filiais filial
setter of the property tt filial tt
public company dao get company dao return company dao
getter of the property tt company dao tt
public void set company dao company dao company dao this company dao company dao
setter of the property tt company dao tt
public string get cliente return cliente
getter of the property tt cliente tt
public void set cliente string cliente this cliente cliente
listter of the property tt cliente tt
public ordem get ordem return ordem
getter of the property tt ordem tt
public float get imposto return imposto
getter of the property tt imposto tt
public void set ordem ordem ordem this ordem ordem
setter of the property tt ordem tt
public void set imposto float imposto this imposto imposto
listter of the property tt imposto tt
public short get imposto option return imposto option
getter of the property tt imposto option tt
public short get raio return raio
getter of the property tt raio tt
public void set raio short raio this raio raio
setter of the property tt raio tt