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:
parent
e3f842da8c
commit
ff64c57b4d
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