It's a common problem for methods to indicate success or failure along with a return value. If you look at String.indexOf() it returns non-negative for a successful find and -1 for not found. And if you look at BufferedReader.readLine() it returns a valid string for good reads and null for end of file. So right from the JDK we have two solutions that are not consistent.
Yikes! How many more ways will we find to indicate some special condition? Quite a few, I'm afraid.
I'd suggest two lessons from this: read the JavaDoc closely on methods you're not familiar with, and try to follow some example in your own methods and document them well so they'll make sense to others. These two examples won't always work ... some times negative answers are valid, sometimes null strings are valid. Then I guess you could look into throwing exceptions.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com