public static File assertReadable ( final File f ) throws FileNotFoundException { if ( ! f . exists ( ) ) { throw new FileNotFoundException ( f . getAbsolutePath ( ) + " does not exist." ) ; } if ( ! f . canRead ( ) ) { throw new FileNotFoundException ( f . getAbsolutePath ( ) + " is not readable." ) ; } return f ; }
Test file exists and is readable .