Skip to content

Commit

Permalink
aspose lib 21.5, fixes, prep for corrupted pst rec
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorthof committed Jul 3, 2021
1 parent ad14524 commit 195357e
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 111 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion Aspose.Email-for-Java
Submodule Aspose.Email-for-Java deleted from 374498
85 changes: 52 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,84 @@
# OST2PST

A while ago I needed something to convert a 5GB Outlook OST file to PST format. Turned out Aspose has a good (commercial) API/library for Java to do exactly that. I had not touched Java for 10 years but got things sorted within a few hours thanks to clear instructions and good examples and docs. I just used the example and made minimal changes, nothing more.

[**Saving to Outlook 2013/2016 PST files is not supported**](https://docs.aspose.com/display/emailjava/Read+and+Convert+Outlook+OST+File#ReadandConvertOutlookOSTFile-ConvertingOSTtoPST)
A while ago I needed something to convert a 5GB Outlook OST file to PST format. Turned out [Aspose](https://products.aspose.com/email) has a good (commercial) API/library for Java to do exactly that. I had not touched Java for 10 years but got things sorted within a few hours thanks to clear instructions and good examples and docs. I just used the example and made minimal changes, nothing more.

[**Saving to Outlook 2013/2016 PST files is not supported**](https://docs.aspose.com/email/java/read-and-convert-outlook-ost-file/#converting-ost-to-pst)

## Download

Get files below or from [Releases page](../../releases/latest)

### Jar and wrappers
**Jar and wrappers:**

* Main executable: [ost2pst.jar](ost2pst.jar) verify: [SHA512SUMS](SHA512SUMS)
* Main executable: [ost2pst.jar](ost2pst.jar) (verify [SHA512SUMS](SHA512SUMS))
* Windows batch file: [ost2pst.bat](ost2pst.bat)
* Linux/BSD shell script: [ost2pst.sh](ost2pst.sh)
* If needed download Java here: [JRE8](https://java.com/en/download/manual.jsp) or alternatively: [JavaSE-RE-8](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)


If you need to install Java use your OS package manager or download it here: [JRE8](https://java.com/en/download/manual.jsp) or alternatively [JavaSE-RE-8](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html).

### Usage

Windows: `ost2pst.bat <input.ost> <output.pst>` _(same for .sh)_
* Windows: `ost2pst.bat <input.ost> <output.pst>`
* Linux: `ost2pst.sh <input.ost> <output.pst>`

* you can also run the jar directly: `java -jar ost2pst.jar`
* the jar needs JRE8
Or run the jar directly: `java -jar ost2pst.jar <input.ost> <output.pst>`

_Remember you need to have at least JRE8 installed, OpenJDK is untested but should work_

### Example

``` batch
C:\src\ost2pst>ost2pst.bat input.ost output.pst
OST2PST (200316)
OST2PST (210619)
INFO: Loading OST file "input.pst" (5GB)
INFO: File format is "64-bit Unicode" (23)
INFO: Loading file "input.pst" (5GB)
Folder [00] "Public"
Folder [01] "Inbox"
Folder [02] "Outbox"
Folder [03] "Sent Items"
INFO: File format is "64-bit Unicode" (23)
INFO: Converting "input.pst" to "output.ost" 511MB/4751MB (11%) |
```

## Building from source

### Import into [Eclipse](https://www.eclipse.org):

* [pom.xml](pom.xml)
* [Loast2pstLoadAndConvertOSTFileCLI.java](src/main/java/com/ost2pst/LoadAndConvertOSTFileCLI.java)

### Get Aspose.Email for Java API/lib (*required*)

* [GitHub Aspose Email-for-Java](https://github.com/aspose-email/Aspose.Email-for-Java)
* [docs.aspose.com Installation (Maven)](https://docs.aspose.com/display/emailjava/Installation)
* [docs.aspose.com Aspose.Email java for Eclipse (Maven)](https://docs.aspose.com/display/emailjava/Aspose.Email+Java+for+Eclipse+-+Maven)

### Create runnable Jar in Eclipse

* use Ant to 'Export', 'Java', 'Runnable JAR file' (used for [ost2pst.jar](ost2pst.jar))
* or alternatively use Maven to build project

## TODO

Add new option that tries to read corrupted ost/pst files. See [here](https://docs.aspose.com/email/java/aspose-email-for-java-20-10-release-notes/#reading-corrupted-pstost-files) for more info.

``` batch
C:\src\ost2pst>ost2pst.bat -c broken.ost
```

## Changelog

### 20210702

* fixed file size formatting: [programming.guide](https://programming.guide/java/formatting-byte-size-to-human-readable-format.html) :)
* updated aspose-email lib to 21.5
* removed aspose-email submodule from git repo

### 20200317

* show file format info
Expand All @@ -64,29 +101,11 @@ INFO: Converting "input.pst" to "output.ost" 511MB/4751MB (11%) |
* improved progress indicator
* updated aspose-email lib to 18.8

## Source

### Import into [Eclipse](https://www.eclipse.org):

* [pom.xml](pom.xml)
* [Loast2pstLoadAndConvertOSTFileCLI.java](src/main/java/com/ost2pst/LoadAndConvertOSTFileCLI.java)

### Aspose.Email for Java API/lib (*required*)

* [GitHub Aspose Email-for-Java](https://github.com/aspose-email/Aspose.Email-for-Java)
* [docs.aspose.com Installation (Maven)](https://docs.aspose.com/display/emailjava/Installation)
* [docs.aspose.com Aspose.Email java for Eclipse (Maven)](https://docs.aspose.com/display/emailjava/Aspose.Email+Java+for+Eclipse+-+Maven)

### Create runnable Jar in Eclipse

* use Ant to 'Export', 'Java', 'Runnable JAR file' (used for [ost2pst.jar](ost2pst.jar))
* or alternatively use Maven to build project

## More info

Aspose.Email for Java: https://products.aspose.com/email/java
What lead me to Aspose: http://wiki.opf-labs.org/pages/viewpage.action?pageId=25887031
Possible alternative https://github.com/rjohnsondev/java-libpst
* Aspose.Email for Java: <https://products.aspose.com/email/java>
* What lead me to Aspose: <http://wiki.opf-labs.org/pages/viewpage.action?pageId=25887031>
* Possible alternative <https://github.com/rjohnsondev/java-libpst>

---
> moved from old repo mkorthof/Aspose.Email-for-Java
Expand Down
2 changes: 1 addition & 1 deletion SHA512SUMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
37b9de0393151f67ada89836f4fda55a36baaaa2d8c336ad172b974dbd8d0a2ddbcc5d8a9d79862d860636dcdb1b06be1db77e3ab0aebbde75c480edb41de561 *ost2pst.jar
c3916d231d57ebdcbf4d7daa7149a1727980dfe79701225d6a0f7e6406fc98bb7bf3fd6bb1ffa5870b95997d0c65aea7fd04f6398721775733bf2bd65abdd8a4 *ost2pst.jar
Binary file modified ost2pst.jar
Binary file not shown.
22 changes: 11 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

<name>ost2pst</name>
<url>https://git.io/JviNA</url>
<version>200316</version>
<version>210703</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- v1.5 is no longer supported https://stackoverflow.com/a/49028811 -->
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<repositories>
Expand All @@ -23,24 +23,21 @@
<name>Aspose Java API</name>
<url>http://artifact.aspose.com/repo/</url>
</repository>
</repositories>
<dependencies>
</repositories><dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-email</artifactId>
<!-- previous version: 19.12 -->
<version>20.2</version>
<!-- previous version: 20.2 -->
<version>21.5</version>
<classifier>jdk16</classifier>
</dependency>
</dependencies>

<build>
</dependencies><build>
<defaultGoal>clean package assembly:single</defaultGoal>
<resources>
<resource>
Expand Down Expand Up @@ -140,4 +137,7 @@
</plugins>
</pluginManagement>
</build>



</project>
Loading

0 comments on commit 195357e

Please sign in to comment.