How to Split PST File using Java

This simple topic focuses on how to split PST File using Java by covering all the necessary details to establish the environment and a program flow to achieve the goal. You will explore split Outlook PST file using Java with the help of a few lines of code that can be used in any Java supported environments including Windows, Linux and macOS.

Steps to Develop PST Splitter using Java

  1. Add the Aspose.Email JAR file reference from the Maven Repository
  2. Add the Aspose.Email namespace in your source file
  3. Create the PersonalStorageQueryBuilder class object to set multiple query criteria
  4. Insert the PersonalStorageQueryBuilder query criteria inside the MailQuery list
  5. Initialize the PersonalStorage class instance to load the source PST file from the disk
  6. Split the source PST file into multiple PST files based on the selected criteria using the splitInto method

The above steps entail the simple process to develop an Outlook PST splitter using Java, whereby PersonalStorageQueryBuilder may be used to define the criteria for splitting a PST file based on the provided query parameters. The queries are included in the MailQuery list, which serves as a PST splitting criteria inside the splitInto method after loading the source PST file from the disk using the PersonalStorage class instance.

Code to Split PST File using Java

This example exhibits that in order to code an application to split PST using Java, a simple API interface exposing the API calls can be used. It is a simple process that is commenced by defining the queries first, which serves as a criterion for splitting the PST file. Subsequently, the PST file is loaded from the disk and then by using the splitInto method the PST is split into multiple PST files.

In this example, we have walked you through to process of splitting a PST using Java. If you are interested in learning about converting an OST file to a PST file using Java, refer to the article on how to convert OST to PST file in Java.

 English