1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-26 14:17:57 +01:00

Add support for CustomSmackConfiguration class

with DISABLED_SMACK_CLASSES String[] option.
This commit is contained in:
Florian Schmaus 2014-03-27 16:09:52 +01:00
parent a1227b78cc
commit a83b44e102

View file

@ -19,6 +19,7 @@ package org.jivesoftware.smack;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -100,6 +101,24 @@ public final class SmackConfiguration {
throw new IllegalStateException(e);
}
try {
Class<?> c = Class.forName("org.jivesoftware.smack.CustomSmackConfiguration");
Field f = c.getField("DISABLED_SMACK_CLASSES");
String[] sa = (String[]) f.get(null);
if (sa != null)
for (String s : sa)
disabledSmackClasses.add(s);
}
catch (ClassNotFoundException e1) {
}
catch (NoSuchFieldException e) {
}
catch (SecurityException e) {
}
catch (IllegalArgumentException e) {
}
catch (IllegalAccessException e) {
}
InputStream configFileStream;
try {