Hi,
Trying to split Big Size PST file to small size PST files. For that purpose I am extracting the MapiMessage from Big PST and creating new PST by adding extracted MapiMessages . for Example:
Given Big PST : Size 1 GB
Requirement : Break to Small PST having size around 100 MB.
Output : Output will be generate approx 10 PSTs having each size around 100 MB.
Core Logic to read MapiMessage from Src and add to Target PST file:
PersonalStorage srcPst = PersonalStorage.fromFile(" D:\sources\input.pst", false);
PersonalStorage targetPst = PersonalStorage.create(“destinationFolder+fileName”,0);
FolderInfo srcFolder = srcPst.getRootFolder().getSubFolder("Inbox);
FolderInfo targetFolder = targetPst.getRootFolder().addSubFolder("Inbox);
IGenericEnumerator enumerable = srcFolder.enumerateMapiMessages().iterator();
while (enumerable.hasNext()){
MapiMessage message = enumerable.next();
targetFolder.addMessage(message);
}
While executing the above logic , Got error like:
exceptionjava.lang.NegativeArraySizeException: -20
Exception in thread “main” java.lang.NegativeArraySizeException: -20
at com.aspose.email.zzn.a(SourceFile:597)
at com.aspose.email.zzn.(SourceFile:125)
at com.aspose.email.zbfh.a(SourceFile:457)
at com.aspose.email.zahx.a(SourceFile:2198)
at com.aspose.email.zahx.a(SourceFile:702)
at com.aspose.email.zawg.a(SourceFile:1132)
at com.aspose.email.FolderInfo.addMessage(SourceFile:758)
We are planning to utilize this library for our requirement but blocked bcoz of this issue.
It needs to be fixed as this is blocker issue to use in our requirement.