private static @NotNull Function<TargetEnvironment, String> addDirToUploadList(@NotNull TargetEnvironmentRequest request,
                                                                        @NotNull Map<@NotNull Path, @NotNull Function<TargetEnvironment, String>> uploadedPaths,
                                                                        @NotNull String dir) {
    Path path = Path.of(dir);
    var uploadRoot = new TargetEnvironment.UploadRoot(path, new TargetEnvironment.TargetPath.Temporary(), true);
    var pathFun = TargetEnvironmentFunctions.getTargetUploadPath(uploadRoot);
    uploadedPaths.put(path, pathFun);
    request.getUploadVolumes().add(uploadRoot);
    return pathFun;
  }
private static @NotNull Function<TargetEnvironment, String> addDirToUploadList(@NotNull TargetEnvironmentRequest request,
                                                                        @NotNull Map<@NotNull Path, @NotNull Function<TargetEnvironment, String>> uploadedPaths,
                                                                        @NotNull String dir)