1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 21:17:58 +01:00

Added isFullJID() helper in StringUtils

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13575 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-03-22 18:13:53 +00:00 committed by flow
parent e3f842da8c
commit ff64c57b4d

View file

@ -362,6 +362,20 @@ public class StringUtils {
}
}
/**
* Returns true if jid is a full JID (i.e. a JID with resource part).
*
* @param jid
* @return true if full JID, false otherwise
*/
public static boolean isFullJID(String jid) {
if (parseName(jid).length() <= 0 || parseServer(jid).length() <= 0
|| parseResource(jid).length() <= 0) {
return false;
}
return true;
}
/**
* Escapes the node portion of a JID according to "JID Escaping" (JEP-0106).
* Escaping replaces characters prohibited by node-prep with escape sequences,