Hey y'all.
I wrote some code to get attachments out of pst files.
I used some of the methods is the PSTAttachment class and it can out empty or blank.
PSTAttachment fileObject = email.getAttachment(walkThroughIndex);
String filename = fileObject.getLongFilename();
System.out.println(filename);
/*get the availible metadata from the java-libpst library
the metadata
*/
String contentDisposition = fileObject.getAttachmentContentDisposition();
System.out.println(contentDisposition);
Date creationTime = fileObject.getCreationTime();
System.out.println(creationTime);
String tagMIME = fileObject.getMimeTag();
System.out.println(tagMIME);
int seqMime = fileObject.getMimeSequence();
Date timeModified = fileObject.getModificationTime();
System.out.println(timeModified);
String pathName = fileObject.getPathname();
System.out.println("Pathname: "+pathName);
String htmlVisibility;
String RTFVisibility;
String MhtmlRef;
if(fileObject.isAttachmentInvisibleInHtml()){
htmlVisibility = "not_visible_in_html";
}
else{
htmlVisibility ="visible_in_html";
}
System.out.println(htmlVisibility);
if(fileObject.isAttachmentInvisibleInRTF()){
RTFVisibility = "not_visible_in_RTF";
}
else{
RTFVisibility ="visible_in_RTF";
}
System.out.println(RTFVisibility);
if(fileObject.isAttachmentMhtmlRef()){
MhtmlRef = "is_Mhtml_REF";
}
else{
MhtmlRef ="is_not_Mhtml_REF";
}
System.out.println(MhtmlRef);
Everything writes out to system blank except the MIME type, timeModified (which is always Null), and creationTime which is also always Null. I learned a little java just to write this program, so it may be that I may be doing something wrong.