Bulk pending cleanup.

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
CraftBukkit/Spigot
2012-09-09 23:19:28 -05:00
parent bc59fff79a
commit 2a57bac117
24 changed files with 45 additions and 52 deletions

View File

@@ -39,7 +39,7 @@ public class BukkitDLUpdaterService {
return "CraftBukkit/" + BukkitDLUpdaterService.class.getPackage().getImplementationVersion() + "/" + System.getProperty("java.version");
}
public ArtifactDetails fetchArtifact(String slug) throws UnsupportedEncodingException, IOException {
public ArtifactDetails fetchArtifact(String slug) throws IOException {
URL url = new URL("http", host, API_PREFIX_ARTIFACT + slug + "/");
InputStreamReader reader = null;
@@ -48,9 +48,7 @@ public class BukkitDLUpdaterService {
connection.setRequestProperty("User-Agent", getUserAgent());
reader = new InputStreamReader(connection.getInputStream());
Gson gson = new GsonBuilder().registerTypeAdapter(Date.class, dateDeserializer).setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create();
ArtifactDetails fromJson = gson.fromJson(reader, ArtifactDetails.class);
return fromJson;
return gson.fromJson(reader, ArtifactDetails.class);
} finally {
if (reader != null) {
reader.close();
@@ -70,7 +68,7 @@ public class BukkitDLUpdaterService {
return null;
}
public ArtifactDetails.ChannelDetails fetchChannel(String slug) throws UnsupportedEncodingException, IOException {
public ArtifactDetails.ChannelDetails fetchChannel(String slug) throws IOException {
URL url = new URL("http", host, API_PREFIX_CHANNEL + slug + "/");
InputStreamReader reader = null;