From 616768a5a9383c0c4eb6ce8a5d432a7ad587ce7e Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 25 Jan 2015 10:35:44 +0100 Subject: [PATCH] Add smack-bosh to Android Projects Replace SaslException with SmackException in XMPPBOSHConnection, that is the exception which is used in XMPPTCPConnection for the same purpose. Also make androidProjects a multi-line list. --- build.gradle | 11 ++++++++++- .../jivesoftware/smack/bosh/XMPPBOSHConnection.java | 6 ++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 8de9f197e..bcffddd94 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,16 @@ allprojects { // build, causing unnecessary rebuilds. builtDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date()) oneLineDesc = 'An Open Source XMPP (Jabber) client library' - androidProjects = [':smack-tcp', ':smack-core', ':smack-im', ':smack-resolver-minidns', ':smack-sasl-provided', ':smack-extensions', ':smack-experimental'].collect{ project(it) } + androidProjects = [ + ':smack-tcp', + ':smack-bosh', + ':smack-core', + ':smack-im', + ':smack-resolver-minidns', + ':smack-sasl-provided', + ':smack-extensions', + ':smack-experimental', + ].collect{ project(it) } androidBootClasspath = getAndroidRuntimeJar() androidJavadocOffline = getAndroidJavadocOffline() } diff --git a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java index b757cb295..3477e62e5 100644 --- a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java +++ b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java @@ -25,8 +25,6 @@ import java.io.Writer; import java.util.logging.Level; import java.util.logging.Logger; -import javax.security.sasl.SaslException; - import org.jivesoftware.smack.AbstractXMPPConnection; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.SmackException.NotConnectedException; @@ -239,7 +237,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { saslAuthentication.authenticate(resource, config.getCallbackHandler()); } } else { - throw new SaslException("No non-anonymous SASL authentication mechanism available"); + throw new SmackException("No non-anonymous SASL authentication mechanism available"); } bindResourceAndEstablishSession(resource); @@ -257,7 +255,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { } else { // Authenticate using Non-SASL - throw new SaslException("No anonymous SASL authentication mechanism available"); + throw new SmackException("No anonymous SASL authentication mechanism available"); } bindResourceAndEstablishSession(null);