From 47a59ad7b3a014e4c46472160cf117c5edbf152c Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 12 Aug 2014 14:43:53 +0200 Subject: [PATCH] Move toBytes() into SASLMechanism as it's a often needed transformation in the SASL world. --- .../main/java/org/jivesoftware/smack/sasl/SASLMechanism.java | 4 ++++ .../smack/sasl/provided/SASLDigestMD5Mechanism.java | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java index 1c92b35bc..08e136884 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java @@ -244,4 +244,8 @@ public abstract class SASLMechanism implements Comparable { } protected abstract SASLMechanism newInstance(); + + protected static byte[] toBytes(String string) { + return StringUtils.toBytes(string); + } } diff --git a/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java b/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java index b0490caea..3181948cf 100644 --- a/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java +++ b/smack-sasl-provided/src/main/java/org/jivesoftware/smack/sasl/provided/SASLDigestMD5Mechanism.java @@ -200,7 +200,4 @@ public class SASLDigestMD5Mechanism extends SASLMechanism { return responseValue; } - private static byte[] toBytes(String string) { - return StringUtils.toBytes(string); - } }