code: public static final FileFormat getFileFormat(Path path, Map<String, ?> env)
      {
          FileFormat fmt = (FileFormat) env.get(FORMAT);
          String filename = path.getFileName().toString();
          if (fmt == null)
          {
              if (filename.endsWith(".tar.gz") || filename.endsWith(".tar") || filename.endsWith(".deb"))
              {
                  fmt = TAR_GNU;
              }
              else
              {
                  fmt = CPIO_CRC;
              }
          }
          return fmt;
      }
docs: Returns FileFormat either from env or using default value which is TAR_GNU
  for tar and CPIO_CRC for others.
  @param path
  @param env
  @return