input
stringlengths
10
828
output
stringlengths
5
107
protected void command finished throws ioexception resets response state sk interest ops sk interest ops sk op read sk interest ops sk interest ops selection key op write response current buffer null response iterator null if remove command after response removes current command cmds remove 0 if cmds is empty parse and handle command if close connection after response closes connection close if close connection after response cb null close connection after response cb run else throw new ioexception connection closed
called after the response to the current command has been written
public void complete response control connection connection if state from get response is positive intermediate resets this command to rnto and tells connection to execute this again state from false fire command intermediate connection connection command finished set command string rnto rename to clear response connection execute this else connection command finished fire command finished connection
there is just one response
public void remove output listener control connection listener l ccls out remove l
removes a listener for outgoing lines
public boolean is failure return get response is permanent negative completion get response is transient negative completion
4xx and 5xx are always a failure
public boolean is success return state from get response is positive completion
success only on 2xx after rnto
protected void fire output char sequence line ccls out fire line
tells listeners about outgoing lines
public void complete response control connection connection if phase phase acct get response is positive intermediate executes pass acct fire command intermediate connection connection command finished phase if phase phase pass set command string pass pass if phase phase acct set command string acct acct clear response connection execute this else connection command finished fire command finished connection
behaviour similar to simple command adds pass acct if required
public int get max response line length return max response line length
returns the maximum length of response lines
public void complete response control connection connection if get response is positive preliminary preliminary used notifies listener and sets fresh response preliminary used true fire command intermediate connection clear response else connection command finished fire command finished connection
accepts at most one preliminary response
public void complete response control connection connection if state rest get response is positive intermediate resets this command to the data cmd and tells connection to execute this again state rest false fire command intermediate connection connection command finished set command string data cmd clear response connection execute this else if preliminary used state rest get response is positive preliminary notifies listener and sets fresh response preliminary used true fire command intermediate connection clear response else connection command finished fire command finished connection
3xx to rest will lead to simple preliminary command behaviour for the
public boolean is success return state rest get response is positive completion
success only on 2xx after rnto
public void set max response line length int length max response line length length
sets the maximum length of response lines
public void complete response control connection connection if get response is positive completion get response get code 257 get response get lines size 0 string line string get response get lines iterator next int start line index of int end line last index of if start 1 end start directory line substring start 1 end replace all super complete response connection
adds directory parsing
public map get features return features
returns the list of feature feature params key value pairs that were
public string get system return sys
gets the system name that was specified in the reply
public void complete response control connection connection connection command finished fire command finished connection
there is just one response
protected map get features map m new hash map http www ietf org internet drafts draft ietf ftpext mlst 16 txt m put mdtm null m put size null m put rest stream if get tvfs support m put tvfs null return m
returns a map of name options pairs
public void complete response control connection connection if is success if ascii connection set type ascii else connection set type image super complete response connection
changes connections transfer type on success
public void set max response lines int max response lines this max response lines max response lines
sets the amount of lines allowed
public boolean parse line string l if finished return false matcher m with code matcher l if m matches with code should be either first or last line but some servers use 123 on every but the last line int new code try new code integer parse int m group 1 if code 0 code new code else if code new code return false catch number format exception wont happen if m group 2 equals finished true lines add m group 3 else without code requires first line if code 0 return false lines add l return true
parses a new line of the response
public list get lines return lines
returns the response lines as strings
protected void clear response set response new response
sets a new and empty response
public void set command response listener command response listener l command response listener l
sets the listener that is called when there are complete responses to
public boolean is complete return finished
returns true if the response is complete according to ftp
public void fire command finished control connection connection if command response listener null command response listener command response this connection true
notifies the listener that this command has finished execution
public void set charset name string charset name if charset null throw new illegal state exception already connected this charset name charset name
sets the name of the charset to be used for control connection io
public void fire command intermediate control connection connection if command response listener null command response listener command response this connection false
notifies the listener that there are intermediate preliminary responses
protected void handle command options string command string options no commands with options command response rf syntax error arguments
handles options setting for some commands
public boolean is root directory return is absolute path size 0
returns true iff this directory represents the root directory that is
public path parent throws illegal state exception if is root directory throw new illegal state exception if path size 0 path remove path size 1 else parent count return this
goes up one directory
public path append string single dir throws illegal state exception if single dir equals dir parent set trailing delimiter false parent else if single dir equals dir current single dir length 0 if single dir ends with delimiter set trailing delimiter true single dir single dir substring 0 single dir length delimiter length else set trailing delimiter false path add single dir return this
appends a single dir or fs node to this path
public path append path rel path throws illegal state exception if is absolute rel path is absolute rel path get ascend count path size throw new illegal state exception if rel path is absolute set absolute true set ascend count rel path get ascend count path new vector rel path path else if rel path get ascend count path size parent count rel path get ascend count path size path clear else path set size path size rel path get ascend count path add all rel path path set trailing delimiter rel path has trailing delimiter return this
appends another path to this path
protected boolean handle command extensions string cmd string arg if cmd equals mdtm if arg null command response rf syntax error arguments else ch modification time this arg return true else if cmd equals size if arg null command response rf syntax error arguments else ch transfer size this arg return true else return false
handles extensions to rfc 959
public boolean ascends return parent count 0
returns true iff this path ascends towards the root directory before it
protected void set ascend count int count parent count count
sets the amount of directories that this path ascends
public int get ascend count return parent count
gets the amount of directories that this path ascends
public list get elements return collections unmodifiable list path
returns an unmodifiable list of path elements
public list get elements modifiable return path
returns an modifiable list of path elements
protected void parse and handle command matcher m cmd pattern matcher string cmds get 0 if m matches invalid cmd command response rf syntax error else handle command m group 1 to lower case m group 2
parses the first command in the queue and calls handle command
public string to string string buffer sb new string buffer if is absolute sb append delimiter else for int i 0 i get ascend count 1 i sb append dir parent sb append delimiter if get ascend count 0 sb append dir parent if path size 0 sb append delimiter for iterator it path iterator it has next sb append string it next if it has next sb append delimiter if has trailing delimiter is absolute sb length 1 sb append delimiter return sb to string
returns the string representation of this path
public path duplicate return path clone
returns a clone of this path
public boolean has trailing delimiter return trailing
returns true iff this path had a trailing delimiter when constructed
public void set trailing delimiter boolean trailing this trailing trailing
sets wether this path has a trailing delimiter
public void close throws ioexception if sc null return if sk null sk cancel sk null sc close
closes this connection
public void clear rb clear
resets the state of this object
public void set command handler command handler command handler ch command handler
sets the command handler
public void set logged in logged in true
sets state to logged in
public void set connection established message string msg response connection established new response 220 msg
sets the response message to be used when a new connection was
public void set response factory response factory response factory rf response factory
sets the response factory to be used by built in command handlers
public void set max command line length int length max command line length length
sets the maximum length of command lines
public boolean get tvfs support return tvfs support
returns wether tvfs as described in
private void initialize this set size 595 369 this set content pane get jcontent pane this set title jframe
this method initializes this
public void save string filename try if this filename filename filename null this filename filename create a new planning file handler planning file handler pfh new planning file handler this open a new file output stream output stream stream new file output stream this filename save the current planning to the stream pfh save stream close the current stream stream close clean up pfh null stream null catch ioexception e todo auto generated catch block e print stack trace
save the current planning into a planning file
public void load string filename throws exception begin with storing the filename for later use this filename filename if new file filename exists file is a real file create the planning file handler instance planning file handler pfh new planning file handler this input stream stream open the filestream with the file stream new file input stream filename load the planning into this window pfh load stream close the current stream stream close when loaded discard the file handler pfh null show resource
load the current planning from file
public iratpplanning get planning return this planning
get the planning reference
private void save resources transformer handler handler throws ioexception create the new resource file hander resource file handler rfh new resource file handler save the planning rfh save get planning handler clean up rfh null
start the save process special for the resources with the planning
private void load resources document planning document throws xpath expression exception create the resource file hander resource file handler rfh new resource file handler parse the file rfh parse this get planning planning document rfh null
load the resource part of the planning file
public string to string final string tab string ret value ret value account detail dto super to string tab key this key tab company this company tab quantity this quantity tab unit this unit tab rate this rate tab entry date this entry date tab return ret value
constructs a code string code with all attributes
public document as xml document doc jsxpath create js4 jdocument try doc get root element add attribute jsxpath js pkg attr key package name doc get root element add as element catch exception e e print stack trace return doc
this will create an xml document from a loaded model
public form result process http servlet request request throws exception return process request locale get default
process the given http servlet request
protected void set name string name if name null this name else this name name
set the form name
public type converter get type converter return type converter
get the default type converter
public storer get storer return storer
get the default storer
public form element get form element string name return form element form elements get name
get the named form element
public form element group get form element group string name return form element group form element groups get name
get the named form element group
public boolean is skip null values return skip null values
return true to skip validation conversion and storage of null values
public void load input stream in throws exception load configuration in
load the configuration from the given input stream
protected void load configuration input stream in throws exception configuration configuration saxconfiguration factory get instance get configuration in load configuration configuration
load the forms configuration information from the given input stream
private void load validator configuration configuration throws exception if configuration null validator form manager get validator configuration
load the default validator
private void load storer configuration configuration throws exception if configuration null string class name configuration get attribute classname if class name null throw new configuration exception storer classname must be specified else storer storer class utilities load class class name new instance storer load configuration configuration
load the default storer
public void set type converter type converter type converter this type converter type converter
set the default type converter
public void set storer storer storer this storer storer
set the default storer
public void set form element string name form element form element form elements put name form element
set the named form element
public void set skip null values boolean skip null values this skip null values skip null values
set to true to skip validation conversion and storage of null values
public void configure internal configuration configuration throws exception
implementations can override this method to configure themselves
public void set form manager form manager form manager this form manager form manager
set the form manager
public string get error message return get error message locale get default
return the validator error message using the default locale
public string get error message locale locale if message provider null try return message provider get message locale catch exception e log error error retrieving message from provider e get message return message provider error e get message else return
get the validator error message for the given locale
public object clone validator clone null try clone validator super clone do i need to deep clone anything here i used to clone the error messages map do i need to clone the message provider catch clone not supported exception e this should not happen log error clone not supported exception caught e get message return clone
clone the validator
public boolean all valid iterator i iterator while i has next validation result validation result validation result i next if validation result is valid return false return true
return true if all validation results in the set are valid
public string get error message return get error message default separator
get the error message for the validation set
public string get error message string separator string buffer buffer new string buffer boolean first true iterator i iterator while i has next validation result validation result validation result i next if validation result is valid if first buffer append separator buffer append validation result get error message if first first false return buffer to string
get the error message for the validation set
public list get validators return validators
get the list of validators in the group
public void configure internal configuration configuration throws exception super configure internal configuration iterator validator elements configuration get children validator iterator while validator elements has next configuration validator element configuration validator elements next validator validator form manager get validator validator element if validator null log debug adding validator to group validators add validator log debug configuration complete
configure the validator
public void set pattern string pattern throws malformed pattern exception if pattern null pattern set pattern compiler compile pattern
set the regular expression pattern to the given string
public void set pattern pattern pattern if pattern null log is debug enabled log debug pattern pattern get pattern this pattern pattern
set the regular expression pattern
public void configure internal configuration configuration throws exception log debug configuring validator string pattern configuration get child value pattern get pattern string log debug pattern pattern set pattern pattern log debug validator configuration complete
configure the validator using the given jdom element
protected string get pattern string if pattern null return null else return pattern get pattern
get the current pattern as a string
public boolean all valid iterator i values iterator while i has next validation result validation result validation result i next if validation result is valid return false return true
return true if all validation results in the map are valid
public boolean is valid string field validation result result validation result get field if result null result is valid return true return false
return true if the given fields validation result is true
public iterator get error messages return get error messages locale get default
get an iterator for all error messages using the default locale
public iterator get error messages locale locale array list error messages new array list iterator results values iterator while results has next validation result result validation result results next if result is valid string error message result get error message locale if error message null error messages add error message return error messages iterator
get an iterator for all error messages in the given locale
public boolean is passed return passed
return true if the script validation passes
public void set passed boolean passed this passed passed
set to true if the script validation passes
public void configure internal configuration configuration throws exception iterator rule elements configuration get children rule iterator while rule elements has next configuration rule element configuration rule elements next string rule class name rule element get value trim rule rule rule class utilities load class rule class name new instance rule configure rule element rules add rule
configure the validator using the given configuration object
public file get script root return script root
get the script root
public void set script root file script root this script root script root
set the script root
public void set script root string script root if script root null set script root new file script root
set the script root
public string get script root type return script root type
get the type for the script root
public void set script root type string script root type this script root type script root type
set the type for the script root