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
- #headers ⇒ Object
- #human_id ⇒ Object
-
#human_sender ⇒ 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
- #thread_index ⇒ Object
- #thread_topic ⇒ Object
Instance Attribute Details
#folder ⇒ Object
Returns the value of attribute folder.
120 121 122 |
# File 'lib/pst/base.rb', line 120 def folder @folder end |
Instance Method Details
#calculated_recipients_string ⇒ Object
196 197 198 |
# File 'lib/pst/base.rb', line 196 def calculated_recipients_string self.recipients.collect{|r| r.pretty_string}.join(", ") end |
#contents ⇒ Object
182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/pst/base.rb', line 182 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
148 149 150 |
# File 'lib/pst/base.rb', line 148 def hash_string Digest::SHA1.hexdigest(human_id) end |
#headers ⇒ Object
209 210 211 212 213 214 215 216 217 218 |
# File 'lib/pst/base.rb', line 209 def headers @headers ||= begin hstr = self.getTransportMessageHeaders hstr.split("\n").inject({}){|acc, line| key,value = line.split(":", 2) acc[key] = value.strip if value acc } end end |
#human_id ⇒ Object
144 145 146 |
# File 'lib/pst/base.rb', line 144 def human_id "%s:%s:%s:%s" % [ folder.human_id, self.getClientSubmitTime.to_s, self.getInternetMessageId, self.subject ] end |
#human_sender ⇒ Object
things to pay attention to next.getDescriptorNode().descriptorIdentifier+“”; next.getSentRepresentingName() + “ <”+ next.getSentRepresentingEmailAddress() “>”; next.getReceivedByName() “ <”+next.getReceivedByAddress()+“>” + next.displayTo(); next.getClientSubmitTime();
140 141 142 |
# File 'lib/pst/base.rb', line 140 def human_sender "%s <%s>" % [sender_name, sender_email] end |
#pretty_string ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/pst/base.rb', line 152 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
165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/pst/base.rb', line 165 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
200 201 202 203 204 205 206 207 |
# File 'lib/pst/base.rb', line 200 def recipients_string orig = self.getRecipientsString if orig == "No recipients table!" calculated_recipients_string else orig end end |
#sent_at ⇒ Object
178 179 180 |
# File 'lib/pst/base.rb', line 178 def sent_at self.getClientSubmitTime.andand.to_time end |
#thread_index ⇒ Object
224 225 226 |
# File 'lib/pst/base.rb', line 224 def thread_index self.headers["Thread-Index"] end |
#thread_topic ⇒ Object
220 221 222 |
# File 'lib/pst/base.rb', line 220 def thread_topic self.headers["Thread-Topic"] end |