1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-14 00:02:05 +01:00

Added isFullJID() helper in StringUtils

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13579 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-03-22 18:14:58 +00:00 committed by flow
parent 26338a2754
commit 3891c738ad

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). * Escapes the node portion of a JID according to "JID Escaping" (JEP-0106).
* Escaping replaces characters prohibited by node-prep with escape sequences, * Escaping replaces characters prohibited by node-prep with escape sequences,