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();
MapiMessage message = enumerable.next();
While executing the above logic , Got error like:
Exception in thread “main” java.lang.NegativeArraySizeException: -20
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.