private static void checkInputFile ( final String name , final File inFile ) { String isFailure = null ; if ( inFile . isDirectory ( ) ) { isFailure = "The " + name + " file is a directory!" ; } else if ( ! inFile . exists ( ) ) { isFailure = "The " + name + " file does not exist!" ; } else if ( ! inFile . canRead ( ) ) { isFailure = "No permissions to read the " + name + " file!" ; } if ( null != isFailure ) { throw new TerminateToolException ( - 1 , isFailure + " Path: " + inFile . getAbsolutePath ( ) ) ; } }
Check input file integrity .