Skip to content

Create crawler to determine available versions and according download URLs #1009

@hohwille

Description

@hohwille

For our epic #941 we have decided to do the implementation in Java what is way more maintainable compared to bash.
This story is about implementing the crawler that is able to determine available versions and according download URLs for a specific tool edition.
Actually we assume already that we will have different implementation strategies for this:

  • github API: retrieve release information as JSON, parse and analyze it
  • maven repository: build the according URL from artifactId and version and download maven-metadata.xml
  • crawl HTML download website
  • specific API of AdoptOpenJDK

In the end we should have a class for every tool-edition that implements the logic to do the update so we can just iterate all of them in the github action workflow.
Such class should therefore extend an according super-class that already contains the logic for the according crawler strategy.
All should extend from this super-class:

public abstract interface SingleUpdater {

  private final String tool;

  private final String edition;

  public SingleUpdater(String tool) {
    this(tool, tool);
  }

  public SingleUpdater(String tool, String edition) {
    super();
    this.tool = tool;
    this.edition = edition;
  }

  public String getTool() {
    return this.tool;
  }

  public String getEdition() {
    return this.edition;
  }

  public void update(UrlRepository repository) {
    UrlEdition edition = repository.getOrCreateChild(this.tool).getOrCreateChild(this.edition);
    doUpdate(edition);
  }

  protected abstract void doUpdate(UrlEdition edition);

}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions