File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
lib/src/main/java/io/github/projectunified/mcserverupdater/updater Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public String getChecksum() {
5959 JSONObject download = getDownload ();
6060 return download .getString ("file_sha256" );
6161 } catch (Exception e ) {
62- e . printStackTrace ( );
62+ debug ( "Failed to get checksum" , e );
6363 return null ;
6464 }
6565 }
Original file line number Diff line number Diff line change 22
33import io .github .projectunified .mcserverupdater .api .JenkinsUpdater ;
44import io .github .projectunified .mcserverupdater .util .VersionQuery ;
5- import me .hsgamer .hscore .web .UserAgent ;
6- import me .hsgamer .hscore .web .WebUtils ;
5+ import io .github .projectunified .mcserverupdater .util .WebUtils ;
76import org .json .JSONArray ;
87import org .json .JSONObject ;
98import org .json .JSONTokener ;
@@ -34,7 +33,7 @@ private void loadVersions() {
3433 String jobsUrl = jenkinsUrl + "api/json?tree=jobs[name]" ;
3534 debug ("Getting jobs from " + jobsUrl );
3635 try {
37- URLConnection connection = UserAgent . CHROME . assignToConnection ( WebUtils .createConnection (jobsUrl ) );
36+ URLConnection connection = WebUtils .openConnection (jobsUrl , updateBuilder );
3837 InputStream inputStream = connection .getInputStream ();
3938 JSONObject jsonObject = new JSONObject (new JSONTokener (inputStream ));
4039 JSONArray jobsArray = jsonObject .getJSONArray ("jobs" );
Original file line number Diff line number Diff line change 44import io .github .projectunified .mcserverupdater .api .DebugConsumer ;
55import io .github .projectunified .mcserverupdater .api .Updater ;
66import io .github .projectunified .mcserverupdater .util .VersionQuery ;
7- import me .hsgamer .hscore .web .UserAgent ;
8- import me .hsgamer .hscore .web .WebUtils ;
7+ import io .github .projectunified .mcserverupdater .util .WebUtils ;
98
109import java .io .File ;
1110import java .io .IOException ;
@@ -28,12 +27,12 @@ private File downloadBuildTools() {
2827 try {
2928 String buildToolsURL = "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar" ;
3029 updateBuilder .debug ("Downloading BuildTools from " + buildToolsURL );
31- URLConnection connection = UserAgent . CHROME . assignToConnection ( WebUtils .createConnection (buildToolsURL ) );
30+ URLConnection connection = WebUtils .openConnection (buildToolsURL , updateBuilder );
3231 InputStream inputStream = connection .getInputStream ();
3332 Files .copy (inputStream , file .toPath (), StandardCopyOption .REPLACE_EXISTING );
3433 return file ;
3534 } catch (IOException e ) {
36- e . printStackTrace ( );
35+ debug ( "Failed to download BuildTools" , e );
3736 return null ;
3837 }
3938 }
You can’t perform that action at this time.
0 commit comments