Skip to content

Commit 77a7c01

Browse files
committed
1 parent 7fa4378 commit 77a7c01

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/main/java/com/pff/PSTObject.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,7 @@ static PSTMessage createAppropriatePSTMessageObject(PSTFile theFile, DescriptorI
670670

671671
PSTTableBCItem item = table.getItems().get(0x001a);
672672
String messageClass = "";
673-
if ( item != null )
674-
{
673+
if ( item != null ) {
675674
messageClass = item.getStringValue();
676675
}
677676

src/main/java/com/pff/PSTTableItem.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public String getStringValue(int stringType) {
7878
if (stringType == VALUE_TYPE_PT_UNICODE) {
7979
// we are a nice little-endian unicode string.
8080
try {
81-
if (isExternalValueReference ) {
81+
if (isExternalValueReference) {
8282
return "External string reference!";
8383
}
84-
return new String(data, "UTF-16LE");
84+
return new String(data, "UTF-16LE").trim();
8585
} catch (UnsupportedEncodingException e) {
8686

8787
System.err.println("Error decoding string: " + data.toString());
@@ -91,7 +91,7 @@ public String getStringValue(int stringType) {
9191

9292
if (stringType == VALUE_TYPE_PT_STRING8 ) {
9393
//System.out.println("Warning! decoding string8 without charset: "+this.entryType + " - "+ Integer.toHexString(this.entryType));
94-
return new String(data, Charset.forName("UTF-8"));
94+
return new String(data, Charset.forName("UTF-8")).trim();
9595
}
9696

9797
StringBuffer outputBuffer = new StringBuffer();

src/main/java/example/Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void processFolder(PSTFolder folder)
4343
PSTMessage email = (PSTMessage)folder.getNextChild();
4444
while (email != null) {
4545
printDepth();
46-
System.out.println("Email: "+email.getSubject());
46+
System.out.println("Email: "+ email.getDescriptorNodeId() + " - " + email.getSubject());
4747
email = (PSTMessage)folder.getNextChild();
4848
}
4949
depth--;

0 commit comments

Comments
 (0)