Skip to content

Commit

Permalink
Update HTTPRequest Library
Browse files Browse the repository at this point in the history
  • Loading branch information
Konloch committed Feb 21, 2023
1 parent 5c0afb0 commit 4257725
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 281 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<fernflower.version>e0d44f4</fernflower.version>
<gson.version>2.10</gson.version>
<guava.version>31.1-jre</guava.version>
<httprequest.version>2.1.0</httprequest.version>
<imgscalr-lib.version>4.2</imgscalr-lib.version>
<jadx.version>1.4.5</jadx.version>
<jd-gui.version>1.6.6bcv</jd-gui.version>
Expand Down Expand Up @@ -73,6 +74,11 @@
</repositories>

<dependencies>
<dependency>
<groupId>com.konloch</groupId>
<artifactId>HTTPRequest</artifactId>
<version>${httprequest.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
Expand Down
276 changes: 0 additions & 276 deletions src/main/java/me/konloch/kontainer/io/HTTPRequest.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.Objects;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import me.konloch.kontainer.io.HTTPRequest;
import com.konloch.httprequest.HTTPRequest;
import org.apache.commons.io.FileUtils;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.Configuration;
Expand Down Expand Up @@ -277,7 +277,6 @@ private static void bootstrap() {

public static void populateUrlList() throws Exception {
HTTPRequest req = new HTTPRequest(new URL("https://github.com/Konloch/bytecode-viewer/tree/master/libs"));
req.setTimeout(30000);
for (String s : req.read())
if (s.contains("href=\"/Konloch/bytecode-viewer/blob/master/libs/")) {
urlList.add("https://github.com" + s.split("href=")[1].split("\"")[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.net.URI;
import java.net.URL;
import javax.swing.JFileChooser;
import me.konloch.kontainer.io.HTTPRequest;
import com.konloch.httprequest.HTTPRequest;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.Configuration;
import the.bytecode.club.bytecodeviewer.api.BCV;
Expand Down Expand Up @@ -256,7 +256,7 @@ private static boolean validURl(String url) throws Exception
{
HTTPRequest request = new HTTPRequest(new URL(url));
request.readSingle();
return request.getStatusCode() == 200;
return request.getLastStatusCode() == 200;
}

private static void download(String url, File saveTo, Runnable onFinish) throws Exception
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package the.bytecode.club.bytecodeviewer.util;

import java.net.URL;
import me.konloch.kontainer.io.HTTPRequest;
import com.konloch.httprequest.HTTPRequest;
import the.bytecode.club.bytecodeviewer.Configuration;

/***************************************************************************
Expand Down

0 comments on commit 4257725

Please sign in to comment.