code: public SAMFormat getFormat(final Path path) throws PathNotFoundException {
  		SAMFormat fmt = formatMap.get(path);
  		if (fmt != null || formatMap.containsKey(path))
  			return fmt;
  
  		if (givenMap)
  			throw new IllegalArgumentException(
  				"SAM format for '"+path+"' not in given map");
  
  		if (this.conf == null)
  			throw new IllegalStateException("Don't have a Configuration yet");
  
  		if (trustExtensions(conf)) {
  			final SAMFormat f = SAMFormat.inferFromFilePath(path);
  			if (f != null) {
  				formatMap.put(path, f);
  				return f;
  			}
  		}
  
  		try {
  			FileSystem fileSystem = path.getFileSystem(conf);
  			if (!fileSystem.exists(path)) {
  				throw new PathNotFoundException(path.toString());
  			}
  			fmt = SAMFormat.inferFromData(fileSystem.open(path));
  		} catch (IOException e) {}
  
  		formatMap.put(path, fmt);
  		return fmt;
  	}
docs: Returns the {@link SAMFormat} corresponding to the given path. Returns
  <code>null</code> if it cannot be determined even based on the file
  contents (unless future SAM/BAM formats are very different, this means
  that the path does not refer to a SAM or BAM file).
  
  <p>If this input format was constructed using a given
  <code>Map&lt;Path,SAMFormat&gt;</code> and the path is not contained
  within that map, throws an {@link IllegalArgumentException}.</p>