code: 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;
      }
docs: Test file exists and is readable.
  @param f File to test.
  @exception FileNotFoundException If file does not exist or is not unreadable.