Consistently capitalize RuneLite
This commit is contained in:
@@ -33,9 +33,9 @@ import okhttp3.OkHttpClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RuneliteAPI
|
||||
public class RuneLiteAPI
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(RuneliteAPI.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(RuneLiteAPI.class);
|
||||
|
||||
public static final String RUNELITE_AUTH = "RUNELITE-AUTH";
|
||||
|
||||
@@ -52,7 +52,7 @@ public class RuneliteAPI
|
||||
{
|
||||
try
|
||||
{
|
||||
InputStream in = RuneliteAPI.class.getResourceAsStream("/runelite.properties");
|
||||
InputStream in = RuneLiteAPI.class.getResourceAsStream("/runelite.properties");
|
||||
properties.load(in);
|
||||
|
||||
version = properties.getProperty("runelite.version");
|
||||
@@ -81,7 +81,7 @@ public class RuneliteAPI
|
||||
|
||||
public static void setVersion(String version)
|
||||
{
|
||||
RuneliteAPI.version = version;
|
||||
RuneLiteAPI.version = version;
|
||||
}
|
||||
|
||||
public static int getRsVersion()
|
||||
@@ -29,7 +29,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.UUID;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -53,7 +53,7 @@ public class AccountClient
|
||||
|
||||
public OAuthResponse login() throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("account")
|
||||
.addPathSegment("login")
|
||||
.build();
|
||||
@@ -64,10 +64,10 @@ public class AccountClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), OAuthResponse.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), OAuthResponse.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ public class AccountClient
|
||||
|
||||
public void logout() throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("account")
|
||||
.addPathSegment("logout")
|
||||
.build();
|
||||
@@ -85,11 +85,11 @@ public class AccountClient
|
||||
logger.debug("Built URI: {}", url);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.header(RuneliteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.header(RuneLiteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
logger.debug("Sent logout request");
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public class AccountClient
|
||||
|
||||
public boolean sesssionCheck()
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("account")
|
||||
.addPathSegment("session-check")
|
||||
.build();
|
||||
@@ -105,11 +105,11 @@ public class AccountClient
|
||||
logger.debug("Built URI: {}", url);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.header(RuneliteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.header(RuneLiteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
return response.isSuccessful();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.UUID;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.Request;
|
||||
@@ -53,21 +53,21 @@ public class ConfigClient
|
||||
|
||||
public Configuration get() throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("config")
|
||||
.build();
|
||||
|
||||
logger.debug("Built URI: {}", url);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.header(RuneliteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.header(RuneLiteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), Configuration.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), Configuration.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ public class ConfigClient
|
||||
|
||||
public void set(String key, String value) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("config")
|
||||
.addPathSegment(key)
|
||||
.build();
|
||||
@@ -86,11 +86,11 @@ public class ConfigClient
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.put(RequestBody.create(TEXT_PLAIN, value))
|
||||
.header(RuneliteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.header(RuneLiteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
logger.debug("Set configuration value '{}' to '{}'", key, value);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class ConfigClient
|
||||
|
||||
public void unset(String key) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("config")
|
||||
.addPathSegment(key)
|
||||
.build();
|
||||
@@ -107,11 +107,11 @@ public class ConfigClient
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.delete()
|
||||
.header(RuneliteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.header(RuneLiteAPI.RUNELITE_AUTH, uuid.toString())
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
logger.debug("Unset configuration value '{}'", key);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
package net.runelite.http.api.examine;
|
||||
|
||||
import java.io.IOException;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.Request;
|
||||
@@ -57,7 +57,7 @@ public class ExamineClient
|
||||
|
||||
private void submit(String type, int id, String text) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("examine")
|
||||
.addPathSegment(type)
|
||||
.addPathSegment(Integer.toString(id))
|
||||
@@ -70,7 +70,7 @@ public class ExamineClient
|
||||
.post(RequestBody.create(TEXT, text))
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
logger.debug("Submitted examine info for {} {}: {}",
|
||||
type, id, text);
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.google.gson.JsonParseException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -41,7 +41,7 @@ public class HiscoreClient
|
||||
|
||||
public HiscoreResult lookup(String username, HiscoreEndpoint endpoint) throws IOException
|
||||
{
|
||||
HttpUrl.Builder builder = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl.Builder builder = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("hiscore")
|
||||
.addPathSegment(endpoint.name().toLowerCase())
|
||||
.addQueryParameter("username", username);
|
||||
@@ -54,10 +54,10 @@ public class HiscoreClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), HiscoreResult.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), HiscoreResult.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class HiscoreClient
|
||||
|
||||
public SingleHiscoreSkillResult lookup(String username, HiscoreSkill skill, HiscoreEndpoint endpoint) throws IOException
|
||||
{
|
||||
HttpUrl.Builder builder = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl.Builder builder = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("hiscore")
|
||||
.addPathSegment(endpoint.name())
|
||||
.addPathSegment(skill.toString().toLowerCase())
|
||||
@@ -86,10 +86,10 @@ public class HiscoreClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), SingleHiscoreSkillResult.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), SingleHiscoreSkillResult.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.google.gson.JsonParseException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -41,7 +41,7 @@ public class ItemClient
|
||||
|
||||
public ItemPrice lookupItemPrice(int itemId) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("item")
|
||||
.addPathSegment("" + itemId)
|
||||
.addPathSegment("price")
|
||||
@@ -53,7 +53,7 @@ public class ItemClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
if (!response.isSuccessful())
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class ItemClient
|
||||
}
|
||||
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), ItemPrice.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), ItemPrice.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ItemClient
|
||||
|
||||
public SearchResult search(String itemName) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("item")
|
||||
.addPathSegment("search")
|
||||
.addQueryParameter("query", itemName)
|
||||
@@ -84,7 +84,7 @@ public class ItemClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
if (!response.isSuccessful())
|
||||
{
|
||||
@@ -93,7 +93,7 @@ public class ItemClient
|
||||
}
|
||||
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), SearchResult.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), SearchResult.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.google.gson.JsonParseException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -42,7 +42,7 @@ public class UpdateCheckClient
|
||||
|
||||
public boolean isOutdated()
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("update-check")
|
||||
.build();
|
||||
|
||||
@@ -52,12 +52,12 @@ public class UpdateCheckClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
ResponseBody body = response.body();
|
||||
|
||||
InputStream in = body.byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), boolean.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), boolean.class);
|
||||
}
|
||||
catch (JsonParseException | IOException ex)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
package net.runelite.http.api.worlds;
|
||||
|
||||
import com.google.gson.JsonParseException;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@@ -43,7 +43,7 @@ public class WorldClient
|
||||
|
||||
public WorldResult lookupWorlds() throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("worlds")
|
||||
.build();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class WorldClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
if (!response.isSuccessful())
|
||||
{
|
||||
@@ -62,7 +62,7 @@ public class WorldClient
|
||||
}
|
||||
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), WorldResult.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), WorldResult.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.List;
|
||||
import net.runelite.http.api.RuneliteAPI;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.Request;
|
||||
@@ -56,9 +56,9 @@ public class XteaClient
|
||||
|
||||
xteaRequest.addKey(xteaKey);
|
||||
|
||||
String json = RuneliteAPI.GSON.toJson(xteaRequest);
|
||||
String json = RuneLiteAPI.GSON.toJson(xteaRequest);
|
||||
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("xtea")
|
||||
.build();
|
||||
|
||||
@@ -69,12 +69,12 @@ public class XteaClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
return RuneliteAPI.CLIENT.newCall(request).execute();
|
||||
return RuneLiteAPI.CLIENT.newCall(request).execute();
|
||||
}
|
||||
|
||||
public List<XteaKey> get() throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("xtea")
|
||||
.build();
|
||||
|
||||
@@ -82,11 +82,11 @@ public class XteaClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
InputStream in = response.body().byteStream();
|
||||
// CHECKSTYLE:OFF
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<XteaKey>>() { }.getType());
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<XteaKey>>() { }.getType());
|
||||
// CHECKSTYLE:ON
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
@@ -97,7 +97,7 @@ public class XteaClient
|
||||
|
||||
public XteaKey get(int region) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneliteAPI.getApiBase().newBuilder()
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("xtea")
|
||||
.addPathSegment(Integer.toString(region))
|
||||
.build();
|
||||
@@ -106,10 +106,10 @@ public class XteaClient
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneliteAPI.CLIENT.newCall(request).execute())
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneliteAPI.GSON.fromJson(new InputStreamReader(in), XteaKey.class);
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), XteaKey.class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user