code: public DataFileReader<GenericRecord> getAvroFile(String file) throws FileBasedHelperException {
      try {
        if (!this.getFileSystem().exists(new Path(file))) {
          LOGGER.warn(file + " does not exist.");
          return null;
        }
        if (this.getState().getPropAsBoolean(ConfigurationKeys.SHOULD_FS_PROXY_AS_USER,
            ConfigurationKeys.DEFAULT_SHOULD_FS_PROXY_AS_USER)) {
          return new DataFileReader<>(new ProxyFsInput(new Path(file), this.getFileSystem()),
              new GenericDatumReader<GenericRecord>());
        }
        return new DataFileReader<>(new FsInput(new Path(file), this.getFileSystem().getConf()),
            new GenericDatumReader<GenericRecord>());
      } catch (IOException e) {
        throw new FileBasedHelperException("Failed to open avro file " + file + " due to error " + e.getMessage(), e);
      }
    }
docs: Returns an {@link DataFileReader} to the specified avro file.
  <p>
  Note: It is the caller's responsibility to close the returned {@link DataFileReader}.
  </p>
  
  @param file The path to the avro file to open.
  @return A {@link DataFileReader} for the specified avro file.
  @throws FileBasedHelperException if there is a problem opening the {@link InputStream} for the specified file.