Class: Java::ComPff::PSTMessage
- Inherits:
-
Object
- Object
- Java::ComPff::PSTMessage
- Defined in:
- lib/pst/base.rb
Instance Attribute Summary collapse
-
#folder ⇒ Object
Returns the value of attribute folder.
Instance Method Summary collapse
- #calculated_recipients_string ⇒ Object
- #contents ⇒ Object
- #hash_string ⇒ Object
-
#human_id ⇒ Object
things to pay attention to next.getDescriptorNode().descriptorIdentifier+“”; next.getSentRepresentingName() + “ <”+ next.getSentRepresentingEmailAddress() “>”; next.getReceivedByName() “ <”+next.getReceivedByAddress()+“>” + next.displayTo(); next.getClientSubmitTime();.
- #pretty_string ⇒ Object
- #recipients ⇒ Object
- #recipients_string ⇒ Object
- #sent_at ⇒ Object
Instance Attribute Details
#folder ⇒ Object
Returns the value of attribute folder.
102 103 104 |
# File 'lib/pst/base.rb', line 102 def folder @folder end |
Instance Method Details
#calculated_recipients_string ⇒ Object
173 174 175 |
# File 'lib/pst/base.rb', line 173 def calculated_recipients_string self.recipients.collect{|r| r.pretty_string}.join(", ") end |
#contents ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/pst/base.rb', line 159 def contents # this is because [Pff::PSTContact, Pff::PSTTask, Pff::PSTActivity, Pff::PSTRss] # are all PSTMessages but they throw a npe if you call getBody begin return self.getBody rescue end begin return self.toString rescue end raise "no contents found in #{self}" end |
#hash_string ⇒ Object
125 126 127 |
# File 'lib/pst/base.rb', line 125 def hash_string Digest::SHA1.hexdigest(human_id) end |
#human_id ⇒ Object
things to pay attention to next.getDescriptorNode().descriptorIdentifier+“”; next.getSentRepresentingName() + “ <”+ next.getSentRepresentingEmailAddress() “>”; next.getReceivedByName() “ <”+next.getReceivedByAddress()+“>” + next.displayTo(); next.getClientSubmitTime();
121 122 123 |
# File 'lib/pst/base.rb', line 121 def human_id "%s:%s:%s:%s" % [ folder.human_id, self.getClientSubmitTime.to_s, self.getInternetMessageId, self.subject ] end |
#pretty_string ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/pst/base.rb', line 129 def pretty_string "[%s] %s - %s <%s> %s <%s> %s %s a:%s" % [ self.getDescriptorNode.descriptorIdentifier, self.getSubject, self.getSentRepresentingName, self.getSentRepresentingEmailAddress, self.getReceivedByName, self.getReceivedByAddress, self.displayTo, self.getClientSubmitTime, self.hasAttachments] end |
#recipients ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/pst/base.rb', line 142 def recipients recip = [] #Enumerator.new do |yielder| i = 0 while i < self.getNumberOfRecipients recipient = self.getRecipient(i) recip << recipient i = i + 1 end #end recip end |
#recipients_string ⇒ Object
177 178 179 180 181 182 183 184 |
# File 'lib/pst/base.rb', line 177 def recipients_string orig = self.getRecipientsString if orig == "No recipients table!" calculated_recipients_string else orig end end |
#sent_at ⇒ Object
155 156 157 |
# File 'lib/pst/base.rb', line 155 def sent_at self.getClientSubmitTime.andand.to_time end |