Remove != String equals.
Replate try-catch blocks to Java 7 compatible version.