public boolean discoverUploadService ( ) throws XMPPException . XMPPErrorException , SmackException . NotConnectedException , InterruptedException , SmackException . NoResponseException { ServiceDiscoveryManager sdm = ServiceDiscoveryManager . getInstanceFor ( connection ( ) ) ; List < DiscoverInfo > servicesDiscoverInfo = sdm . findServicesDiscoverInfo ( NAMESPACE , true , true ) ; if ( servicesDiscoverInfo . isEmpty ( ) ) { servicesDiscoverInfo = sdm . findServicesDiscoverInfo ( NAMESPACE_0_2 , true , true ) ; if ( servicesDiscoverInfo . isEmpty ( ) ) { return false ; } } DiscoverInfo discoverInfo = servicesDiscoverInfo . get ( 0 ) ; defaultUploadService = uploadServiceFrom ( discoverInfo ) ; return true ; }
Discover upload service .