Hi,
I am using the java api version - aspose-email-3.6.0-java. My requirement is to take a input pstfile - extract the message - add a header to each message - create a new pst file and add all the messages.
Since the pst file is not decreasing in size when deleting messages, I am creating a new pst file.
Now while adding messages to the new pst file if the process is terminated - I want to start from where it left. So I have created a text file and added the list of message entry id to the text file and I check before adding each message to the new pst file.
Now if the destination pst file already exist ( means process is terminated abruptly), if processed normally pst file would have been added to the ZIP file and it will be deleted.
So if the PST file exist _ I am loading from the file else I create a new file but while loading the PST file which was half processed - Api throws the below exception. I cannot delete the PST and recreate the PST file since that will increase the processing time and a PST file may contains thousands of messages.
I have attached the PST file for your investigation.
Code:
if(!destPstExist){
destPst = PersonalStorage.create(dest.toString(), FileFormatVersion.Unicode);
}else{
destPst = PersonalStorage.fromFile(dest.toString());
}
Exception while loading from file
java.lang.RuntimeException: Header CRC is not valid !
at com.aspose.email.gW.j(Unknown Source)
at com.aspose.email.gW.b(Unknown Source)
at com.aspose.email.gW.(Unknown Source)
at com.aspose.email.et.(Unknown Source)
at com.aspose.email.hN.(Unknown Source)
at com.aspose.email.PersonalStorage.a(Unknown Source)
at com.aspose.email.PersonalStorage.fromFile(Unknown Source)
at com.aspose.email.PersonalStorage.fromFile(Unknown Source)
at com.batch.uidinjector.UniqueIdInjector.pstToPST(UniqueIdInjector.java:585)
Please let me know how to resolve this.