Access MS Exchange with Java

If you want to access an MS Exchange server to read messages, notes, tasks, calenders, contacts, … there is a library which has been provided by Microsoft. It's called EWS Java API1.1 and provides the package microsoft.exchange.webservices.data. However the Library is kind of abandoned but it does still work with Exchange 2010 SP1. Unfortunately it does have some old dependencies and makes some trouble if you try to compile it. I created a jar which includes the necessary libraries and can be used with Java 6 and Java 7.

 

It is on my Maven Repository. You can add the repository with:

and the Library with

 

You can also just download the Jar: EWS Java API1.1.5

Tika parseToString returns empty string when calling with a word-document

If you get an empty string from the parseToString method (and you don't get an exception) it is usually the lack of the tika-parsers-0.9.jar file.

As soon as you add it (including it's dependencies poi-3.7, poi-ooxml-3.7, poi-ooxml-schmeas-3.7, dom4j-1.6.1, geronimo-stax-api_1.0, xmlbeans-2.3, poi-scratchpad and commons-compress) to the classpath you will get the text.

The ugly part about this problem is that your program will always run just fine when you only reference tika-core-0.9.jar. But when you try to parse documents it will always instanciate an EmptyParser (because there is no parser supporting your mime-type ;D). The EmptyParser will return an empty string but there won't be an exception.