From c3b42035543ed1e3028ee1c8925c8587c0f55378 Mon Sep 17 00:00:00 2001 From: Emma Stone Date: Wed, 11 Jan 2017 22:57:53 +0000 Subject: [PATCH 1/4] [FEATURE] Added Library To The Client #requiresJar() should be changed. --- pom.xml | 2 +- .../core/lib/jpushbullet/JPushBullet.java | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java diff --git a/pom.xml b/pom.xml index 0f5810a..4944707 100755 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.parabot client - 2.6.2 + 2.6.3 jar diff --git a/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java b/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java new file mode 100644 index 0000000..6f0242b --- /dev/null +++ b/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java @@ -0,0 +1,71 @@ +package org.parabot.core.lib.jpushbullet; + +import org.parabot.core.Core; +import org.parabot.core.Directories; +import org.parabot.core.build.BuildPath; +import org.parabot.core.lib.Library; + +import java.io.File; +import java.net.URL; + +/** + * @author EmmaStone + */ +public class JPushBullet extends Library { + private static boolean valid; + + @Override + public void init() { + if (!hasJar()) { + System.err.println("Failed to load jpushbullet... [jar missing]"); + return; + } + Core.verbose("Adding jpushbullet jar file to build path: " + + getJarFileURL().getPath()); + BuildPath.add(getJarFileURL()); + + try { + Class.forName("com.shakethat.jpushbullet.net.PushbulletClient"); + valid = true; + } catch (ClassNotFoundException e) { + System.err + .println("Failed to add jpushbullet to build path, or incorrupt download"); + } + + Core.verbose("JPushBullet initialized."); + } + + @Override + public boolean isAdded() { + return valid; + } + + @Override + public File getJarFile() { + return new File(Directories.getCachePath(), "jpushbullet.jar"); + } + + @Override + public URL getDownloadLink() { + try { + return new URL("https://github.com/silk8192/jpushbullet/releases/download/1.0/jpushbullet-1.0.jar"); + } catch (Throwable t) { + t.printStackTrace(); + } + return null; + } + + @Override + public boolean requiresJar() { + return false; + } + + @Override + public String getLibraryName() { + return "JPushBullet"; + } + + public static boolean isValid() { + return valid; + } +} From 1817800135d619d24ba86cfc7487fa7da376afd5 Mon Sep 17 00:00:00 2001 From: Emma Stone Date: Wed, 11 Jan 2017 22:58:30 +0000 Subject: [PATCH 2/4] [BUGFIX] Made requiresJar true instead of false --- src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java b/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java index 6f0242b..0bd5078 100644 --- a/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java +++ b/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java @@ -57,7 +57,7 @@ public class JPushBullet extends Library { @Override public boolean requiresJar() { - return false; + return true; } @Override From 6559261154ec89af30512c4fd7b23f384a0e2669 Mon Sep 17 00:00:00 2001 From: Emma Stone Date: Mon, 6 Feb 2017 17:22:53 +0000 Subject: [PATCH 3/4] [TASK] Updated download link --- .../java/org/parabot/core/lib/jpushbullet/JPushBullet.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java b/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java index 0bd5078..0f7fdfc 100644 --- a/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java +++ b/src/main/java/org/parabot/core/lib/jpushbullet/JPushBullet.java @@ -1,5 +1,6 @@ package org.parabot.core.lib.jpushbullet; +import org.parabot.core.Configuration; import org.parabot.core.Core; import org.parabot.core.Directories; import org.parabot.core.build.BuildPath; @@ -48,7 +49,7 @@ public class JPushBullet extends Library { @Override public URL getDownloadLink() { try { - return new URL("https://github.com/silk8192/jpushbullet/releases/download/1.0/jpushbullet-1.0.jar"); + return new URL(Configuration.LIBRARIES_DOWNLOAD + "/JPushBullet"); } catch (Throwable t) { t.printStackTrace(); } From f7c1c47fe844293d016bce9d2f88bfa72d0ce079 Mon Sep 17 00:00:00 2001 From: JKetelaar Date: Mon, 6 Feb 2017 19:50:04 +0100 Subject: [PATCH 4/4] [BUGFIX] Updated internal API version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3f6630..4c9fcaf 100755 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ org.parabot internal-api - 1.4.5 + 1.4.5.1