Skip to content

Commit

Permalink
Add pingRepository to GitHubRestConnector
Browse files Browse the repository at this point in the history
Returns only the HTTP status code
  • Loading branch information
dabico committed Jan 8, 2024
1 parent 79545fe commit 5d795d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/ch/usi/si/seart/github/GitHubRestConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ public JsonObject searchRepositories(String language, Range<Date> dateRange, Int
return execute(new RestCallback(url)).getJsonObject();
}

public HttpStatus pingRepository(String name) {
URL url = Endpoint.REPOSITORY.toURL(name.split("/"));
RestCallback callback = new RestCallback(url);
RestResponse response = execute(callback);
return response.getStatus();
}

@SuppressWarnings("ConstantConditions")
public JsonArray getRepositoryLabels(String name) {
JsonArray array = new JsonArray();
Expand Down

0 comments on commit 5d795d7

Please sign in to comment.