code: protected void check(File file) throws IOException {
          if(!file.exists()) {
              throw new FileNotFoundException(file.getAbsolutePath());
          }
          
          if(file.isDirectory()) {
              throw new IOException("Cannot open directory " + file.getAbsolutePath());
          }
      }
docs: Checks the existence of the specified file.
  
  @throws IOException