From 1e29c8830246a17f060654d43d970a00ce94122a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 25 Jun 2017 15:06:49 +0300 Subject: commons-lang3 deprecated classes -> commons-text and commons-codec --- .../java/com/juick/components/configuration/XmppInitializer.java | 2 +- juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'juick-xmpp/src') diff --git a/juick-xmpp/src/main/java/com/juick/components/configuration/XmppInitializer.java b/juick-xmpp/src/main/java/com/juick/components/configuration/XmppInitializer.java index 28dab1ef..ac33acc5 100644 --- a/juick-xmpp/src/main/java/com/juick/components/configuration/XmppInitializer.java +++ b/juick-xmpp/src/main/java/com/juick/components/configuration/XmppInitializer.java @@ -1,6 +1,6 @@ package com.juick.components.configuration; -import org.apache.commons.lang3.CharEncoding; +import org.apache.commons.codec.CharEncoding; import org.springframework.web.filter.CharacterEncodingFilter; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java index 99df858e..a5d71be1 100644 --- a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java +++ b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionOut.java @@ -5,7 +5,7 @@ import com.juick.components.s2s.util.DialbackUtils; import com.juick.xmpp.extensions.StreamError; import com.juick.xmpp.extensions.StreamFeatures; import com.juick.xmpp.utils.XmlUtils; -import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.text.RandomStringGenerator; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -32,11 +32,12 @@ public class ConnectionOut extends Connection implements Runnable { public String to; String checkSID = null; String dbKey = null; + RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange('a', 'z').build(); public ConnectionOut(XMPPServer xmpp, String hostname) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, XmlPullParserException, KeyManagementException, KeyStoreException, IOException { super(xmpp); to = hostname; - dbKey = DialbackUtils.generateDialbackKey(RandomStringUtils.randomAscii(15), to, xmpp.HOSTNAME, streamID); + dbKey = DialbackUtils.generateDialbackKey(generator.generate(15), to, xmpp.HOSTNAME, streamID); } public ConnectionOut(XMPPServer xmpp, String hostname, String checkSID, String dbKey) throws Exception { -- cgit v1.2.3