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;
    }
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.
@param f File to test.
@exception FileNotFoundException If file does not exist or is not unreadable.