docs: private void processFileCompressionTypes() throws SnowflakeSQLException
    {
      // see what user has told us about the source file compression types
      boolean autoDetect = true;
      FileCompressionType userSpecifiedSourceCompression = null;
  
      if (SOURCE_COMPRESSION_AUTO_DETECT.equalsIgnoreCase(sourceCompression))
      {
        autoDetect = true;
      }
      else if (SOURCE_COMPRESSION_NONE.equalsIgnoreCase(sourceCompression))
      {
        autoDetect = false;
      }
      else
      {
        userSpecifiedSourceCompression =
            FileCompressionType.lookupByMimeSubType(sourceCompression.toLowerCase());
  
        if (userSpecifiedSourceCompression == null)
        {
          throw new SnowflakeSQLException(SqlState.FEATURE_NOT_SUPPORTED,
                                          ErrorCode.COMPRESSION_TYPE_NOT_KNOWN.getMessageCode(),
                                          sourceCompression);
        }
        else if (!userSpecifiedSourceCompression.isSupported())
        {
          throw new SnowflakeSQLException(SqlState.FEATURE_NOT_SUPPORTED,
                                          ErrorCode.COMPRESSION_TYPE_NOT_SUPPORTED.getMessageCode(),
                                          sourceCompression);
        }
  
        autoDetect = false;
      }
  
      if (!sourceFromStream)
      {
        for (String srcFile : sourceFiles)
        {
          FileMetadata fileMetadata = fileMetadataMap.get(srcFile);
  
          if (fileMetadata.resultStatus == ResultStatus.NONEXIST ||
              fileMetadata.resultStatus == ResultStatus.DIRECTORY)
          {
            continue;
          }
  
          File file = new File(srcFile);
          String srcFileName = file.getName();
  
          String mimeTypeStr = null;
          FileCompressionType currentFileCompressionType = null;
  
          try
          {
            if (autoDetect)
            {
              // probe the file for compression type using tika file type detector
              mimeTypeStr = Files.probeContentType(file.toPath());
  
              if (mimeTypeStr == null)
              {
                try (FileInputStream f = new FileInputStream(file))
                {
                  byte[] magic = new byte[4];
                  if (f.read(magic, 0, 4) == 4)
                  {
                    if (Arrays.equals(magic, new byte[]{'P', 'A', 'R', '1'}))
                    {
                      mimeTypeStr = "snowflake/parquet";
                    }
                    else if (Arrays.equals(
                        Arrays.copyOfRange(magic, 0, 3), new byte[]{'O', 'R', 'C'}))
                    {
                      mimeTypeStr = "snowflake/orc";
                    }
                  }
                }
              }
  
              if (mimeTypeStr != null)
              {
                logger.debug("Mime type for {} is: {}", srcFile, mimeTypeStr);
  
                currentFileCompressionType = mimeTypeToCompressionType(mimeTypeStr);
              }
  
              // fallback: use file extension
              if (currentFileCompressionType == null)
              {
                mimeTypeStr = getMimeTypeFromFileExtension(srcFile);
  
                if (mimeTypeStr != null)
                {
                  logger.debug("Mime type for {} is: {}", srcFile, mimeTypeStr);
                  currentFileCompressionType = mimeTypeToCompressionType(mimeTypeStr);
                }
              }
            }
            else
            {
              currentFileCompressionType = userSpecifiedSourceCompression;
            }
  
            // check if the compression type is supported by us
            if (currentFileCompressionType != null)
            {
              fileMetadata.srcCompressionType = currentFileCompressionType;
  
              if (currentFileCompressionType.isSupported())
              {
                // remember the compression type if supported
                fileMetadata.destCompressionType = currentFileCompressionType;
                fileMetadata.requireCompress = false;
                fileMetadata.destFileName = srcFileName;
                logger.debug("File compression detected as {} for: {}",
                             currentFileCompressionType.name(), srcFile);
              }
              else
              {
                // error if not supported
                throw new SnowflakeSQLException(SqlState.FEATURE_NOT_SUPPORTED,
                                                ErrorCode.COMPRESSION_TYPE_NOT_SUPPORTED.getMessageCode(),
                                                currentFileCompressionType.name());
              }
            }
            else
            {
              // we want to auto compress the files unless the user has disabled it
              logger.debug("Compression not found for file: {}", srcFile);
  
              // Set compress flag
              fileMetadata.requireCompress = autoCompress;
              fileMetadata.srcCompressionType = null;
  
              if (autoCompress)
              {
                // We only support gzip auto compression
                fileMetadata.destFileName = srcFileName +
                                            FileCompressionType.GZIP.fileExtension;
                fileMetadata.destCompressionType = FileCompressionType.GZIP;
              }
              else
              {
                fileMetadata.destFileName = srcFileName;
                fileMetadata.destCompressionType = null;
              }
            }
          }
          catch (MimeTypeParseException ex)
          {
            logger.error(
                "Exception encountered when processing file compression types",
                ex);
  
            fileMetadata.resultStatus = ResultStatus.ERROR;
            fileMetadata.errorDetails = "Failed to parse mime type: " +
                                        mimeTypeStr;
          }
          catch (Exception ex)
          {
  
            // SNOW-13146: don't log severe message for user error
            if (ex instanceof SnowflakeSQLException)
            {
              logger.debug(
                  "Exception encountered when processing file compression types",
                  ex);
            }
            else
            {
              logger.debug(
                  "Exception encountered when processing file compression types",
                  ex);
            }
  
            fileMetadata.resultStatus = ResultStatus.ERROR;
            fileMetadata.errorDetails = ex.getMessage();
          }
        }
      }
      else
      {
        // source from stream case
        FileMetadata fileMetadata = fileMetadataMap.get(SRC_FILE_NAME_FOR_STREAM);
        fileMetadata.srcCompressionType = userSpecifiedSourceCompression;
  
        if (compressSourceFromStream)
        {
          fileMetadata.destCompressionType = FileCompressionType.GZIP;
          fileMetadata.requireCompress = true;
        }
        else
        {
          fileMetadata.destCompressionType = userSpecifiedSourceCompression;
          fileMetadata.requireCompress = false;
        }
  
        // add gz extension if file name doesn't have it
        if (compressSourceFromStream &&
            !destFileNameForStreamSource.endsWith(
                FileCompressionType.GZIP.fileExtension))
        {
          fileMetadata.destFileName = destFileNameForStreamSource +
                                      FileCompressionType.GZIP.fileExtension;
        }
        else
        {
          fileMetadata.destFileName = destFileNameForStreamSource;
        }
      }
    }