input
stringlengths
10
828
output
stringlengths
5
107
public int hash code return set flags hash code flags hash code
compute a hash code for this object
public boolean match message msg return match part msg
the match method
public boolean match message msg address from try from msg get from catch exception e return false if from null return false for int i 0 i from length i if super match from i return true return false
the address comparator
public boolean match message msg string s try s msg get header message id catch exception e return false if s null return false for int i 0 i s length i if super match s i return true return false
the match method
public void close throws ioexception if in null return try if master sf force close else sf close finally sf null in null buf null
closes this input stream and releases any system resources
public boolean match message msg int msgno try msgno msg get message number catch exception e return false return super match msgno
the match method
public long get position system out println get position start start pos pos bufpos bufpos bufpos pos start if in null throw new runtime exception stream closed return bufpos pos start
return the current position in the input stream as an
public int hash code return ignore case pattern hash code pattern hash code
compute a hash code for this object
public input stream new stream long start long end if in null throw new runtime exception stream closed if start 0 throw new illegal argument exception start 0 if end 1 end datalen return new shared file input stream sf this start int start int end start bufsize
return a new input stream representing a subset of the data
public date get date return new date date get time
return the date to compare with
public date get sent date throws messaging exception string s get header date null if s null try synchronized mail date format return mail date format parse s catch parse exception pex return null return null
returns the value of the rfc 822 date field
protected boolean match date d switch comparison case le return d before date d equals date case lt return d before date case eq return d equals date case ne return d equals date case gt return d after date case ge return d after date d equals date default return false
the date comparison method
protected void finalize throws throwable super finalize close
force this stream to close
public int hash code return date hash code super hash code
compute a hash code for this object
public void set content multipart mp throws messaging exception set data handler new data handler mp mp get content type mp set parent this
this method sets the body parts content to a multipart object
protected boolean match address a return a equals address
match against the argument address
public int hash code return address hash code
compute a hash code for this object
public boolean match message msg address recipients try recipients msg get recipients type catch exception e return false if recipients null return false for int i 0 i recipients length i if super match recipients i return true return false
the match method
public int hash code int hash 0 for int i 0 i terms length i hash terms i hash code return hash
compute a hash code for this object
public int hash code return type hash code super hash code
compute a hash code for this object
public boolean match message msg date d try d msg get received date catch exception e return false if d null return false return super match d
the match method
public boolean match message msg for int i 0 i terms length i if terms i match msg return false return true
the and operation
public boolean match message msg date d try d msg get sent date catch exception e return false if d null return false return super match d
the match method
public string get header name return header name
return the name of the header to compare with
public boolean match message msg string headers try headers msg get header header name catch exception e return false if headers null return false for int i 0 i headers length i if super match headers i return true return false
the header match method
public int hash code return number super hash code
compute a hash code for this object
public void attach file file file throws ioexception messaging exception file data source fds new file data source file this set data handler new data handler fds this set file name fds get name
use the specified file to provide the data for this part
public search term get term return term
return the term to negate
public void set sent date date d throws messaging exception if d null remove header date else synchronized mail date format set header date mail date format format d
set the rfc 822 date header field
public int hash code xxx depends on header comparisons being case independent return header name to lower case locale english hash code super hash code
compute a hash code for this object
public int hash code return term hash code 1
compute a hash code for this object
public void attach file string file throws ioexception messaging exception file f new file file attach file f
use the specified file to provide the data for this part
public date get received date throws messaging exception return null
returns the date on this message was received
public store get store throws no such provider exception return get store get property mail store protocol
get a store object that implements this users desired store
public void save file file file throws ioexception messaging exception output stream out null input stream in null try out new buffered output stream new file output stream file in this get input stream byte buf new byte 8192 int len while len in read buf 0 out write buf 0 len finally close streams but don t mask original exception if any try if in null in close catch ioexception ex try if out null out close catch ioexception ex
save the contents of this part in the specified file
public store get store string protocol throws no such provider exception return get store new urlname protocol null 1 null null null
get a store object that implements the specified protocol
public int get size throws messaging exception if content null return content length if content stream null try int size content stream available only believe the size if it s greater than zero since zero is the default returned by the input stream class itself if size 0 return size catch ioexception ex ignore it return 1
return the size of the content of this message in bytes
public void save file string file throws ioexception messaging exception file f new file file save file f
save the contents of this part in the specified file
public store get store urlname url throws no such provider exception string protocol url get protocol provider p get provider protocol return get store p url
get a store object for the given urlname
public store get store provider provider throws no such provider exception return get store provider null
get an instance of the store specified by provider
public boolean is subscribed return true
returns true if this folder is subscribed
public string get content type throws messaging exception string s get header content type null if s null return text plain return s
returns the value of the rfc 822 content type header field
public transport get transport throws no such provider exception return get transport get property mail transport protocol
get a transport object that implements this users desired
public boolean is mime type string mime type throws messaging exception return mime body part is mime type this mime type
is this part of the specified mime type this method
public int get mode if is open throw new illegal state exception folder not open return mode
return the open mode of this folder
public transport get transport urlname url throws no such provider exception string protocol url get protocol provider p get provider protocol return get transport p url
get a transport object for the given urlname
public void remove header string name throws messaging exception headers remove header name
remove all headers with this name
public string get disposition throws messaging exception return mime body part get disposition this
returns the value of the content disposition header field
public enumeration get all headers throws messaging exception return headers get all headers
return all the headers from this message as an enumeration of
public void set disposition string disposition throws messaging exception mime body part set disposition this disposition
set the content disposition header field of this message
protected void notify connection listeners int type if connection listeners null connection event e new connection event this type queue event e connection listeners fix for broken jdk1 1 x garbage collector the conservative gc in jdk1 1 x occasionally fails to garbage collect threads which are in the wait state this would result in thread and consequently memory leaks we attempt to fix this by sending a terminator event to the queue after we ve sent the closed event the terminator event causes the event dispatching thread to self destruct if type connection event closed terminate queue
notify all connection listeners
public string get encoding throws messaging exception return mime body part get encoding this
returns the content transfer encoding from the
public void add header line string line throws messaging exception headers add header line line
add a header line to this body part
protected void notify folder listeners int type if folder listeners null folder event e new folder event this this type queue event e folder listeners store notify folder listeners type this
notify all folder listeners registered on this folder and
public password authentication get password authentication urlname url return password authentication auth table get url
return any saved password authentication for this store or transport
public enumeration get all header lines throws messaging exception return headers get all header lines
get all header lines as an enumeration of strings
protected void notify folder renamed listeners folder folder if folder listeners null folder event e new folder event this this folder folder event renamed queue event e folder listeners store notify folder renamed listeners this folder
notify all folder listeners registered on this folder and
protected void notify message added listeners message msgs if message count listeners null return message count event e new message count event this message count event added false msgs queue event e message count listeners
notify all message count listeners about the addition of messages
protected void update headers throws messaging exception update headers this if we ve cached a multipart or message object then we re now committed to using this instance of the object and we discard any stream data used to create this object if cached content null dh new data handler cached content get content type cached content null content null if content stream null try content stream close catch ioexception ioex nothing to do content stream null
examine the content of this body part and update the appropriate
public message get message try return get message part catch messaging exception ex return null
return the message that contains the content
public session get session message msg get message return msg null msg session null
return the session were operating in
public string get description throws messaging exception return mime body part get description this
returns the content description header field of this message
protected void notify message changed listeners int type message msg if message changed listeners null return message changed event e new message changed event this type msg queue event e message changed listeners
notify all message changed listeners
private void load file string name stream loader loader input stream clis null try clis new buffered input stream new file input stream name loader load clis if debug pr debug successfully loaded file name catch ioexception e if debug pr debug not loading file name pr debug e catch security exception sex if debug pr debug not loading file name pr debug sex finally try if clis null clis close catch ioexception ex ignore it
load from the named file
private void load resource string name class cl stream loader loader input stream clis null try clis get resource as stream cl name if clis null loader load clis if debug pr debug successfully loaded resource name else if debug pr debug not loading resource name catch ioexception e if debug pr debug e catch security exception sex if debug pr debug sex finally try if clis null clis close catch ioexception ex ignore it
load from the named resource
public void run queue element qe try loop while qe dequeue null mail event e qe event vector v qe vector for int i 0 i v size i try e dispatch v element at i catch throwable t if t instanceof interrupted exception break loop ignore anything else thrown by the listener qe null e null v null catch interrupted exception e just die
pull events off the queue and dispatch them
public string get message id throws messaging exception return get header message id null
returns the value of the message id header field
public string get username return do encode decode username username
returns the user name of this urlname
public string get password return do encode decode password password
returns the password of this urlname
public string get file name throws messaging exception return mime body part get file name this
get the filename associated with this message
public url get url throws malformed urlexception return new url get protocol get host get port get file
constructs a url from the urlname
public int hash code if hash code 0 return hash code if protocol null hash code protocol hash code inet address addr get host address if addr null hash code addr hash code else if host null hash code host to lower case locale english hash code if username null hash code username hash code if file null hash code file hash code hash code port return hash code
compute the hash code for this urlname
public void set resource limit string name long limit if resources null resources new quota resource 1 resources 0 new quota resource name 0 limit return for int i 0 i resources length i if resources i name equals ignore case name resources i limit limit return quota resource ra new quota resource resources length 1 system arraycopy resources 0 ra 0 resources length ra ra length 1 new quota resource name 0 limit resources ra
set a resource limit for this quota root
public void set file name string filename throws messaging exception mime body part set file name this filename
set the filename associated with this part if possible
public node get named item string name int i find name point name 0 return i 0 null node nodes element at i get named item string node
retrieve a node by name
public node get named item ns string namespace uri string local name int i find name point namespace uri local name return i 0 null node nodes element at i get named item ns string string node
introduced in dom level 2
public node clone node boolean deep document impl newdoc new document impl clone node newdoc deep experimental newdoc mutation events mutation events return newdoc clone node boolean node
deep clone a document including fixing owner doc for the cloned
public short get node type return node comment node
a short integer indicating what type of node this is
protected input stream get content stream throws messaging exception if content stream null return shared input stream content stream new stream 0 1 if content null return new shared byte array input stream content throw new messaging exception no content
produce the raw bytes of the content
public string get node name return comment
returns the node name
public domimplementation get implementation currently implemented as a singleton since it s hardcoded information anyway return domimplementation impl get domimplementation
retrieve information describing the abilities of this particular
public boolean has feature string feature string version currently we support only xml level 1 version 1 0 boolean any version version null version length 0 return feature equals ignore case core any version version equals 1 0 version equals 2 0 feature equals ignore case xml any version version equals 1 0 version equals 2 0 has feature string string boolean
test if the dom implementation supports a specific feature
protected int find name point string name int start binary search int i 0 if nodes null int first start int last nodes size 1 while first last i first last 2 int test name compare to node nodes element at i get node name if test 0 return i name found else if test 0 last i 1 else first i 1 if first i i first return 1 i not found has to be encoded find name point string int
subroutine locate the named item or the point at which said item
protected void set user data node impl n object data if user data null user data new hashtable if data null user data remove n else user data put n data
store user data related to a given node
public short get node type return node entity reference node
a short integer indicating what type of node this is
public string get node name if needs sync data synchronize data return name
returns the name of the entity referenced
public node list get child nodes synchronize return super get child nodes
perform synchronize before accessing children
public node get first child synchronize return super get first child
perform synchronize before accessing children
public node get last child synchronize return super get last child
perform synchronize before accessing children
public int get length synchronize return super get length
query the number of children in the entity definition
public boolean has child nodes synchronize return super has child nodes
returns whether this node has any children
public node item int index synchronize return super item index
returns the node at the given index
protected void synchronize if first child null return document type doctype named node map entities entity impl ent def if null doctype get owner document get doctype null entities doctype get entities ent def entity impl entities get named item get node name no entity by this name stop here if ent def null return if entity s definition exists clone its kids is read only false for node defkid ent def get first child defkid null defkid defkid get next sibling node newkid defkid clone node true insert before newkid null set read only true true
entity references children are a reflection of those defined in the
public short get node type return node document fragment node
a short integer indicating what type of node this is
protected void clone content named node map impl srcmap if srcmap nodes null if nodes null nodes new vector srcmap nodes size else nodes set size srcmap nodes size for int i 0 i srcmap nodes size i node impl n node impl srcmap nodes element at i node impl clone node impl n clone node true clone is specified n is specified nodes insert element at clone i clone owner node owner node clone is owned true clone content attribute map
override parents method to set the owner node correctly
public object get content throws ioexception messaging exception if cached content null return cached content object c try c get data handler get content catch folder closed ioexception fex throw new folder closed exception fex get folder fex get message catch message removed ioexception mex throw new message removed exception mex get message if mime body part cache multipart c instanceof multipart c instanceof message content null content stream null cached content c return c
return the content as a java object
public string get node name return document fragment
returns the node name
private static transient node list singleton node list new node list public node item int index return null public int get length return 0
empty child nodes
public short get node type return node element node
a short integer indicating what type of node this is
protected void set node value internal string value if is read only throw new domexception domexception no modification allowed err dom001 modification not allowed revisit may want to set the value in owner document default behavior overridden in some subclasses if needs sync data synchronize data keep old value for document notification string oldvalue this data core document impl owner document owner document notify document owner document modifying character data this this data value notify document owner document modified character data this oldvalue value
this function added so that we can distinguish whether