code: public static Archiver createArchiver(FileType fileType) {
          if (fileType == FileType.UNKNOWN) {
              throw new IllegalArgumentException("Unknown file type");
          }
  
          if (fileType.isArchive() && fileType.isCompressed()) {
              return createArchiver(fileType.getArchiveFormat(), fileType.getCompressionType());
          } else if (fileType.isArchive()) {
              return createArchiver(fileType.getArchiveFormat());
          } else {
              throw new IllegalArgumentException("Unknown archive file extension " + fileType);
          }
      }
docs: Creates an Archiver that handles the given {@link FileType}. The Archiver may handle compression inherently, if
  the {@link FileType} uses a compression type, such as ".tgz" might.
  
  @param fileType the file type
  @return a new Archiver instance (that may also handle compression)