public static boolean isServiceEnabled ( final XMPPConnection connection ) { ServiceDiscoveryManager manager = ServiceDiscoveryManager . getInstanceFor ( connection ) ; List < String > namespaces = new ArrayList <> ( ) ; namespaces . addAll ( Arrays . asList ( NAMESPACE ) ) ; namespaces . add ( DataPacketExtension . NAMESPACE ) ; if ( ! IBB_ONLY ) { namespaces . add ( Bytestream . NAMESPACE ) ; } for ( String namespace : namespaces ) { if ( ! manager . includesFeature ( namespace ) ) { return false ; } } return true ; }
Checks to see if all file transfer related services are enabled on the connection .