Java 类org.jivesoftware.smack.provider.ProviderFileLoader 实例源码

项目:androidclient    文件:SmackInitializer.java   
public static void initialize(Context context) {
    if (!sInitialized) {
        disableSmackDefault();

        InputStream is = context.getResources().openRawResource(R.raw.service);
        ProviderManager.addLoader(new ProviderFileLoader(is));
        try {
            is.close();
        }
        catch (IOException ignored) {
        }

        // FIXME these got to be fixed somehow (VCard4 is not even used anymore)
        ProviderManager.addIQProvider(VCard4.ELEMENT_NAME, VCard4.NAMESPACE, new VCard4.Provider());
        ProviderManager.addIQProvider(ServerlistCommand.ELEMENT_NAME, ServerlistCommand.NAMESPACE, new ServerlistCommand.ResultProvider());

        // do not append Smack version
        VersionManager.setAutoAppendSmackVersion(false);

        // we want to manually handle roster stuff
        Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.manual);

        sInitialized = true;
    }
}