本文整理匯總了Java中org.jivesoftware.smack.util.StringUtils.parseServer方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.parseServer方法的具體用法?Java StringUtils.parseServer怎麽用?Java StringUtils.parseServer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jivesoftware.smack.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.parseServer方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: xmppAddressToJid
import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public static String xmppAddressToJid(String participant) {
final String address = StringUtils.parseServer(participant);
final String[] parts = address.split("\\."); //$NON-NLS-1$
final String server = parts[parts.length-1];
final String nick = StringUtils.parseResource(participant);
return nick+"@"+server+JabberClient.JID_RESOURCE; //$NON-NLS-1$
}
示例2: isEmailAvailable
import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
/**
* The workgroup service may be configured to send email. This queries the Workgroup Service
* to see if the email service has been configured and is available.
*
* @return true if the email service is available, otherwise return false.
*/
public boolean isEmailAvailable() {
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(connection);
try {
String workgroupService = StringUtils.parseServer(workgroupJID);
DiscoverInfo infoResult = discoManager.discoverInfo(workgroupService);
return infoResult.containsFeature("jive:email:provider");
}
catch (XMPPException e) {
return false;
}
}
示例3: getRawJid
import org.jivesoftware.smack.util.StringUtils; //導入方法依賴的package包/類
public String getRawJid() {
if (jid.contains("/")) { //$NON-NLS-1$
return StringUtils.parseName(jid) + "@" + StringUtils.parseServer(jid); //$NON-NLS-1$
}
return jid;
}