-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathPSTContact.java
More file actions
1135 lines (1017 loc) · 28.1 KB
/
PSTContact.java
File metadata and controls
1135 lines (1017 loc) · 28.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright 2010 Richard Johnson & Orin Eman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ---
*
* This file is part of java-libpst.
*
* java-libpst is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* java-libpst is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with java-libpst. If not, see <http://www.gnu.org/licenses/>.
*
*/
package com.pff;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
/**
* Class for Contacts
*
* @author Richard Johnson
*/
public class PSTContact extends PSTMessage {
/**
* Instantiates a new Pst contact.
*
* @param theFile the the file
* @param descriptorIndexNode the descriptor index node
* @throws PSTException the pst exception
* @throws IOException the io exception
*/
public PSTContact(final PSTFile theFile, final DescriptorIndexNode descriptorIndexNode)
throws PSTException, IOException {
super(theFile, descriptorIndexNode);
}
/**
* Instantiates a new Pst contact.
*
* @param theFile the the file
* @param folderIndexNode the folder index node
* @param table the table
* @param localDescriptorItems the local descriptor items
*/
public PSTContact(final PSTFile theFile, final DescriptorIndexNode folderIndexNode, final PSTTableBC table,
final HashMap<Integer, PSTDescriptorItem> localDescriptorItems) {
super(theFile, folderIndexNode, table, localDescriptorItems);
}
/**
* Contact's Account name
*
* @return the account
*/
public String getAccount() {
return this.getStringItem(0x3a00);
}
/**
* Callback telephone number
*
* @return the callback telephone number
*/
public String getCallbackTelephoneNumber() {
return this.getStringItem(0x3a02);
}
/**
* Contact's generational abbreviation FTK: Name suffix
*
* @return the generation
*/
public String getGeneration() {
return this.getStringItem(0x3a05);
}
/**
* Contacts given name
*
* @return the given name
*/
public String getGivenName() {
return this.getStringItem(0x3a06);
}
/**
* Contacts Government ID Number
*
* @return the government id number
*/
public String getGovernmentIdNumber() {
return this.getStringItem(0x3a07);
}
/**
* Business/Office Telephone Number
*
* @return the business telephone number
*/
public String getBusinessTelephoneNumber() {
return this.getStringItem(0x3a08);
}
/**
* Home Telephone Number
*
* @return the home telephone number
*/
public String getHomeTelephoneNumber() {
return this.getStringItem(0x3a09);
}
/**
* Contacts initials
*
* @return the initials
*/
public String getInitials() {
return this.getStringItem(0x3a0a);
}
/**
* Keyword
*
* @return the keyword
*/
public String getKeyword() {
return this.getStringItem(0x3a0b);
}
/**
* Contact's language
*
* @return the language
*/
public String getLanguage() {
return this.getStringItem(0x3a0c);
}
/**
* Contact's location
*
* @return the location
*/
public String getLocation() {
return this.getStringItem(0x3a0d);
}
/**
* MHS Common Name
*
* @return the mhs common name
*/
public String getMhsCommonName() {
return this.getStringItem(0x3a0f);
}
/**
* Organizational identification number
*
* @return the organizational id number
*/
public String getOrganizationalIdNumber() {
return this.getStringItem(0x3a10);
}
/**
* Contact's surname FTK: Last name
*
* @return the surname
*/
public String getSurname() {
return this.getStringItem(0x3a11);
}
/**
* Original display name
*
* @return the original display name
*/
public String getOriginalDisplayName() {
return this.getStringItem(0x3a13);
}
/**
* Default Postal Address
*
* @return the postal address
*/
public String getPostalAddress() {
return this.getStringItem(0x3a15);
}
/**
* Contact's company name
*
* @return the company name
*/
public String getCompanyName() {
return this.getStringItem(0x3a16);
}
/**
* Contact's job title FTK: Profession
*
* @return the title
*/
public String getTitle() {
return this.getStringItem(0x3a17);
}
/**
* Contact's department name Used in contact item
*
* @return the department name
*/
public String getDepartmentName() {
return this.getStringItem(0x3a18);
}
/**
* Contact's office location
*
* @return the office location
*/
public String getOfficeLocation() {
return this.getStringItem(0x3a19);
}
/**
* Primary Telephone
*
* @return the primary telephone number
*/
public String getPrimaryTelephoneNumber() {
return this.getStringItem(0x3a1a);
}
/**
* Contact's secondary office (business) phone number
*
* @return the business 2 telephone number
*/
public String getBusiness2TelephoneNumber() {
return this.getStringItem(0x3a1b);
}
/**
* Mobile Phone Number
*
* @return the mobile telephone number
*/
public String getMobileTelephoneNumber() {
return this.getStringItem(0x3a1c);
}
/**
* Radio Phone Number
*
* @return the radio telephone number
*/
public String getRadioTelephoneNumber() {
return this.getStringItem(0x3a1d);
}
/**
* Car Phone Number
*
* @return the car telephone number
*/
public String getCarTelephoneNumber() {
return this.getStringItem(0x3a1e);
}
/**
* Other Phone Number
*
* @return the other telephone number
*/
public String getOtherTelephoneNumber() {
return this.getStringItem(0x3a1f);
}
/**
* Transmittable display name
*
* @return the transmittable display name
*/
public String getTransmittableDisplayName() {
return this.getStringItem(0x3a20);
}
/**
* Pager Phone Number
*
* @return the pager telephone number
*/
public String getPagerTelephoneNumber() {
return this.getStringItem(0x3a21);
}
/**
* Primary Fax Number
*
* @return the primary fax number
*/
public String getPrimaryFaxNumber() {
return this.getStringItem(0x3a23);
}
/**
* Contact's office (business) fax number
*
* @return the business fax number
*/
public String getBusinessFaxNumber() {
return this.getStringItem(0x3a24);
}
/**
* Contact's home fax number
*
* @return the home fax number
*/
public String getHomeFaxNumber() {
return this.getStringItem(0x3a25);
}
/**
* Business Address Country
*
* @return the business address country
*/
public String getBusinessAddressCountry() {
return this.getStringItem(0x3a26);
}
/**
* Business Address City
*
* @return the business address city
*/
public String getBusinessAddressCity() {
return this.getStringItem(0x3a27);
}
/**
* Business Address State
*
* @return the business address state or province
*/
public String getBusinessAddressStateOrProvince() {
return this.getStringItem(0x3a28);
}
/**
* Business Address Street
*
* @return the business address street
*/
public String getBusinessAddressStreet() {
return this.getStringItem(0x3a29);
}
/**
* Business Postal Code
*
* @return the business postal code
*/
public String getBusinessPostalCode() {
return this.getStringItem(0x3a2a);
}
/**
* Business PO Box
*
* @return the business po box
*/
public String getBusinessPoBox() {
return this.getStringItem(0x3a2b);
}
/**
* Telex Number
*
* @return the telex number
*/
public String getTelexNumber() {
return this.getStringItem(0x3a2c);
}
/**
* ISDN Number
*
* @return the isdn number
*/
public String getIsdnNumber() {
return this.getStringItem(0x3a2d);
}
/**
* Assistant Phone Number
*
* @return the assistant telephone number
*/
public String getAssistantTelephoneNumber() {
return this.getStringItem(0x3a2e);
}
/**
* Home Phone 2
*
* @return the home 2 telephone number
*/
public String getHome2TelephoneNumber() {
return this.getStringItem(0x3a2f);
}
/**
* Assistant�s Name
*
* @return the assistant
*/
public String getAssistant() {
return this.getStringItem(0x3a30);
}
/**
* Hobbies
*
* @return the hobbies
*/
public String getHobbies() {
return this.getStringItem(0x3a43);
}
/**
* Middle Name
*
* @return the middle name
*/
public String getMiddleName() {
return this.getStringItem(0x3a44);
}
/**
* Display Name Prefix (Contact Title)
*
* @return the display name prefix
*/
public String getDisplayNamePrefix() {
return this.getStringItem(0x3a45);
}
/**
* Profession
*
* @return the profession
*/
public String getProfession() {
return this.getStringItem(0x3a46);
}
/**
* Preferred By Name
*
* @return the preferred by name
*/
public String getPreferredByName() {
return this.getStringItem(0x3a47);
}
/**
* Spouse�s Name
*
* @return the spouse name
*/
public String getSpouseName() {
return this.getStringItem(0x3a48);
}
/**
* Computer Network Name
*
* @return the computer network name
*/
public String getComputerNetworkName() {
return this.getStringItem(0x3a49);
}
/**
* Customer ID
*
* @return the customer id
*/
public String getCustomerId() {
return this.getStringItem(0x3a4a);
}
/**
* TTY/TDD Phone
*
* @return the ttytdd phone number
*/
public String getTtytddPhoneNumber() {
return this.getStringItem(0x3a4b);
}
/**
* Ftp Site
*
* @return the ftp site
*/
public String getFtpSite() {
return this.getStringItem(0x3a4c);
}
/**
* Manager�s Name
*
* @return the manager name
*/
public String getManagerName() {
return this.getStringItem(0x3a4e);
}
/**
* Nickname
*
* @return the nickname
*/
public String getNickname() {
return this.getStringItem(0x3a4f);
}
/**
* Personal Home Page
*
* @return the personal home page
*/
public String getPersonalHomePage() {
return this.getStringItem(0x3a50);
}
/**
* Business Home Page
*
* @return the business home page
*/
public String getBusinessHomePage() {
return this.getStringItem(0x3a51);
}
/**
* Note
*
* @return the note
*/
public String getNote() {
return this.getStringItem(0x6619);
}
/**
* Gets named string item.
*
* @param key the key
* @return the named string item
*/
String getNamedStringItem(final int key) {
final int id = this.pstFile.getNameToIdMapItem(key, PSTFile.PSETID_Address);
if (id != -1) {
return this.getStringItem(id);
}
return "";
}
/**
* Gets smtp address.
*
* @return the smtp address
*/
public String getSMTPAddress() {
return this.getNamedStringItem(0x00008084);
}
/**
* Company Main Phone
*
* @return the company main phone number
*/
public String getCompanyMainPhoneNumber() {
return this.getStringItem(0x3a57);
}
/**
* Children's names
*
* @return the childrens names
*/
public String getChildrensNames() {
return this.getStringItem(0x3a58);
}
/**
* Home Address City
*
* @return the home address city
*/
public String getHomeAddressCity() {
return this.getStringItem(0x3a59);
}
/**
* Home Address Country
*
* @return the home address country
*/
public String getHomeAddressCountry() {
return this.getStringItem(0x3a5a);
}
/**
* Home Address Postal Code
*
* @return the home address postal code
*/
public String getHomeAddressPostalCode() {
return this.getStringItem(0x3a5b);
}
/**
* Home Address State or Province
*
* @return the home address state or province
*/
public String getHomeAddressStateOrProvince() {
return this.getStringItem(0x3a5c);
}
/**
* Home Address Street
*
* @return the home address street
*/
public String getHomeAddressStreet() {
return this.getStringItem(0x3a5d);
}
/**
* Home Address Post Office Box
*
* @return the home address post office box
*/
public String getHomeAddressPostOfficeBox() {
return this.getStringItem(0x3a5e);
}
/**
* Other Address City
*
* @return the other address city
*/
public String getOtherAddressCity() {
return this.getStringItem(0x3a5f);
}
/**
* Other Address Country
*
* @return the other address country
*/
public String getOtherAddressCountry() {
return this.getStringItem(0x3a60);
}
/**
* Other Address Postal Code
*
* @return the other address postal code
*/
public String getOtherAddressPostalCode() {
return this.getStringItem(0x3a61);
}
/**
* Other Address State
*
* @return the other address state or province
*/
public String getOtherAddressStateOrProvince() {
return this.getStringItem(0x3a62);
}
/**
* Other Address Street
*
* @return the other address street
*/
public String getOtherAddressStreet() {
return this.getStringItem(0x3a63);
}
/**
* Other Address Post Office box
*
* @return the other address post office box
*/
public String getOtherAddressPostOfficeBox() {
return this.getStringItem(0x3a64);
}
///////////////////////////////////////////////////
// Below are the values from the name to id map...
///////////////////////////////////////////////////
/**
* File under FTK: File as
*
* @return the file under
*/
public String getFileUnder() {
return this.getNamedStringItem(0x00008005);
}
/**
* Home Address
*
* @return the home address
*/
public String getHomeAddress() {
return this.getNamedStringItem(0x0000801a);
}
/**
* Business Address
*
* @return the work address
*/
public String getWorkAddress() {
return this.getNamedStringItem(0x0000801b);
}
/**
* Other Address
*
* @return the other address
*/
public String getOtherAddress() {
return this.getNamedStringItem(0x0000801c);
}
/**
* Selected Mailing Address
*
* @return the postal address id
*/
public int getPostalAddressId() {
return this.getIntItem(this.pstFile.getNameToIdMapItem(0x00008022, PSTFile.PSETID_Address));
}
/**
* Webpage
*
* @return the html
*/
public String getHtml() {
return this.getNamedStringItem(0x0000802b);
}
/**
* Business Address City
*
* @return the work address street
*/
public String getWorkAddressStreet() {
return this.getNamedStringItem(0x00008045);
}
/**
* Business Address Street
*
* @return the work address city
*/
public String getWorkAddressCity() {
return this.getNamedStringItem(0x00008046);
}
/**
* Business Address State
*
* @return the work address state
*/
public String getWorkAddressState() {
return this.getNamedStringItem(0x00008047);
}
/**
* Business Address Postal Code
*
* @return the work address postal code
*/
public String getWorkAddressPostalCode() {
return this.getNamedStringItem(0x00008048);
}
/**
* Business Address Country
*
* @return the work address country
*/
public String getWorkAddressCountry() {
return this.getNamedStringItem(0x00008049);
}
/**
* Business Address Country
*
* @return the work address post office box
*/
public String getWorkAddressPostOfficeBox() {
return this.getNamedStringItem(0x0000804A);
}
/**
* IM Address
*
* @return the instant messaging address
*/
public String getInstantMessagingAddress() {
return this.getNamedStringItem(0x00008062);
}
/**
* E-mail1 Display Name
*
* @return the email 1 display name
*/
public String getEmail1DisplayName() {
return this.getNamedStringItem(0x00008080);
}
/**
* E-mail1 Address Type
*
* @return the email 1 address type
*/
public String getEmail1AddressType() {
return this.getNamedStringItem(0x00008082);
}
/**
* E-mail1 Address
*
* @return the email 1 email address
*/
public String getEmail1EmailAddress() {
return this.getNamedStringItem(0x00008083);
}
/**
* E-mail1 Display Name
*
* @return the email 1 original display name
*/
public String getEmail1OriginalDisplayName() {
return this.getNamedStringItem(0x00008084);
}
/**
* E-mail1 type
*
* @return the email 1 email type
*/
public String getEmail1EmailType() {
return this.getNamedStringItem(0x00008087);
}
/**
* E-mail2 display name
*
* @return the email 2 display name
*/
public String getEmail2DisplayName() {
return this.getNamedStringItem(0x00008090);
}
/**
* E-mail2 address type
*
* @return the email 2 address type
*/
public String getEmail2AddressType() {
return this.getNamedStringItem(0x00008092);
}
/**
* E-mail2 e-mail address
*
* @return the email 2 email address
*/
public String getEmail2EmailAddress() {
return this.getNamedStringItem(0x00008093);
}
/**
* E-mail2 original display name
*
* @return the email 2 original display name
*/
public String getEmail2OriginalDisplayName() {
return this.getNamedStringItem(0x00008094);
}
/**
* E-mail3 display name
*
* @return the email 3 display name
*/
public String getEmail3DisplayName() {
return this.getNamedStringItem(0x000080a0);
}
/**
* E-mail3 address type
*
* @return the email 3 address type
*/
public String getEmail3AddressType() {
return this.getNamedStringItem(0x000080a2);
}
/**
* E-mail3 e-mail address
*
* @return the email 3 email address
*/
public String getEmail3EmailAddress() {
return this.getNamedStringItem(0x000080a3);
}
/**
* E-mail3 original display name
*
* @return the email 3 original display name
*/
public String getEmail3OriginalDisplayName() {
return this.getNamedStringItem(0x000080a4);
}
/**
* Fax1 Address Type
*
* @return the fax 1 address type
*/
public String getFax1AddressType() {
return this.getNamedStringItem(0x000080b2);
}
/**
* Fax1 Email Address
*
* @return the fax 1 email address
*/
public String getFax1EmailAddress() {
return this.getNamedStringItem(0x000080b3);
}
/**
* Fax1 Original Display Name
*
* @return the fax 1 original display name
*/
public String getFax1OriginalDisplayName() {
return this.getNamedStringItem(0x000080b4);
}
/**