Skip to content

Commit

Permalink
use java.rtx.pub for java metadata (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Oct 5, 2023
1 parent 1f8b65d commit 09516f4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/plugins/core/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,20 +362,19 @@ static JAVA_FILE_TYPES: Lazy<HashSet<String>> =

fn download_java_metadata(release_type: &str) -> Result<Vec<JavaMetadata>> {
let http = http::Client::new()?;
let resp = http
.get("https://joschi.github.io/java-metadata/metadata/all.json")
.send()?;
let url = format!(
"https://java.rtx.pub/metadata/{}/{}/{}.json",
release_type,
os(),
arch()
);
let resp = http.get(url).send()?;
http.ensure_success(&resp)?;

let metadata = resp
.json::<Vec<JavaMetadata>>()?
.into_iter()
.filter(|m| {
m.architecture == arch()
&& m.os == os()
&& JAVA_FILE_TYPES.contains(&m.file_type)
&& m.release_type == release_type
})
.filter(|m| JAVA_FILE_TYPES.contains(&m.file_type))
.collect();
Ok(metadata)
}

0 comments on commit 09516f4

Please sign in to comment.