client: replace HttpUrl.parse with HttpUrl.get

This commit is contained in:
Adam
2022-04-16 19:23:04 -04:00
parent 3218fc7568
commit 439ebe22e4
3 changed files with 6 additions and 6 deletions

View File

@@ -125,7 +125,7 @@ public class RuneLiteProperties
public static HttpUrl getPluginHubBase() public static HttpUrl getPluginHubBase()
{ {
String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_VERSION)); String version = System.getProperty(PLUGINHUB_VERSION, properties.getProperty(PLUGINHUB_VERSION));
return HttpUrl.parse(properties.get(PLUGINHUB_BASE) + "/" + version); return HttpUrl.get(properties.get(PLUGINHUB_BASE) + "/" + version);
} }
public static String getApiBase() public static String getApiBase()

View File

@@ -199,7 +199,7 @@ public class ClientLoader implements Supplier<Applet>
private RSConfig downloadConfig() throws IOException private RSConfig downloadConfig() throws IOException
{ {
HttpUrl url = HttpUrl.parse(javConfigUrl); HttpUrl url = HttpUrl.get(javConfigUrl);
IOException err = null; IOException err = null;
for (int attempt = 0; attempt < NUM_ATTEMPTS; attempt++) for (int attempt = 0; attempt < NUM_ATTEMPTS; attempt++)
{ {
@@ -249,7 +249,7 @@ public class ClientLoader implements Supplier<Applet>
@Nonnull @Nonnull
private RSConfig downloadFallbackConfig() throws IOException private RSConfig downloadFallbackConfig() throws IOException
{ {
RSConfig backupConfig = clientConfigLoader.fetch(HttpUrl.parse(RuneLiteProperties.getJavConfigBackup())); RSConfig backupConfig = clientConfigLoader.fetch(HttpUrl.get(RuneLiteProperties.getJavConfigBackup()));
if (Strings.isNullOrEmpty(backupConfig.getCodeBase()) || Strings.isNullOrEmpty(backupConfig.getInitialJar()) || Strings.isNullOrEmpty(backupConfig.getInitialClass())) if (Strings.isNullOrEmpty(backupConfig.getCodeBase()) || Strings.isNullOrEmpty(backupConfig.getInitialJar()) || Strings.isNullOrEmpty(backupConfig.getInitialClass()))
{ {
@@ -319,13 +319,13 @@ public class ClientLoader implements Supplier<Applet>
if (config.isFallback()) if (config.isFallback())
{ {
// If we are using the backup config, use our own gamepack and ignore the codebase // If we are using the backup config, use our own gamepack and ignore the codebase
url = HttpUrl.parse(config.getRuneLiteGamepack()); url = HttpUrl.get(config.getRuneLiteGamepack());
} }
else else
{ {
String codebase = config.getCodeBase(); String codebase = config.getCodeBase();
String initialJar = config.getInitialJar(); String initialJar = config.getInitialJar();
url = HttpUrl.parse(codebase + initialJar); url = HttpUrl.get(codebase + initialJar);
} }
for (int attempt = 0; ; attempt++) for (int attempt = 0; ; attempt++)

View File

@@ -68,7 +68,7 @@ import okhttp3.Response;
public class ImageCapture public class ImageCapture
{ {
private static final DateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss"); private static final DateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.parse("https://api.imgur.com/3/image"); private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.get("https://api.imgur.com/3/image");
private static final MediaType JSON = MediaType.parse("application/json"); private static final MediaType JSON = MediaType.parse("application/json");
private final Client client; private final Client client;