String resolve() throws IOException {

    String from =
        String.format("%s/v%s/%s.zip", GITHUB_DOWNLOAD_PREFIX, getSDKVersion(), buildFileName());

    if (!Strings.isNullOrEmpty(options.getPrismLocation())) {
      checkArgument(
          !options.getPrismLocation().startsWith(GITHUB_TAG_PREFIX),
          "Provided --prismLocation URL is not an Apache Beam Github "
              + "Release page URL or download URL: ",
          from);

      from = options.getPrismLocation();
    }

    String fromFileName = getNameWithoutExtension(from);
    Path to = Paths.get(userHome(), PRISM_BIN_PATH, fromFileName);

    if (Files.exists(to)) {
      return to.toString();
    }

    createDirectoryIfNeeded(to);

    if (from.startsWith("http")) {
      String result = resolve(new URL(from), to);
      checkState(Files.exists(to), "Resolved location does not exist: %s", result);
      return result;
    }

    String result = resolve(Paths.get(from), to);
    checkState(Files.exists(to), "Resolved location does not exist: %s", result);
    return result;
  }
@Test
  public void givenVersionOverride_thenResolves() throws IOException {
    assertThat(Files.exists(DESTINATION_DIRECTORY)).isFalse();
    PrismPipelineOptions options = options();
    options.setPrismVersionOverride("2.57.0");
    PrismLocator underTest = new PrismLocator(options);
    String got = underTest.resolve();
    assertThat(got).contains(DESTINATION_DIRECTORY.toString());
    assertThat(got).contains("2.57.0");
    Path gotPath = Paths.get(got);
    assertThat(Files.exists(gotPath)).isTrue();
  }