private string? GetUploaderFullPath()

in src/ServiceProfiler.EventPipe.Otel/Microsoft.ApplicationInsights.Profiler.Shared/Services/UploaderProxy/UploaderLocatorByUnzipping.cs [49:84]


    private string? GetUploaderFullPath(string zipFolder)
    {
        string zipPath = Path.Combine(zipFolder, TraceUploaderArchiveFileName);

        if (FileService.Exists(zipPath))
        {
            Logger.LogDebug("Found zipped uploader at {filePath}. Extracting...", zipPath);
            string targetFolder = _userCacheManager.UploaderDirectory.FullName;
            Directory.CreateDirectory(targetFolder);

            try
            {
                _zipFileService.ExtractToDirectory(zipPath, targetFolder);
            }
            catch (IOException ex)
            {
                Logger.LogWarning(ex, "Extracting uploader failed. Is the target directory {folder} exists or is it writable?", targetFolder);
            }

            string unzippedUploaderPath = Path.Combine(targetFolder, TraceUploaderAssemblyName);
            if (FileService.Exists(unzippedUploaderPath))
            {
                return unzippedUploaderPath;
            }
            else
            {
                Logger.LogDebug("Target unzipped uploader not found at {filePath}", unzippedUploaderPath);
                return null;
            }
        }
        else
        {
            Logger.LogDebug("Zipped uploader's not found at {filePath}", zipPath);
            return null;
        }
    }