mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-23 13:07:59 +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:
parent
26338a2754
commit
3891c738ad
1 changed files with 14 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue