LDAP groovy 访问代码样例
class LdapDumper {
def ldifFile
def isLDIFSafe(str) {
//return false;
if (str.size() == 0)
return true;
def chr = str.charAt(0);
if (chr == ' ' || chr == ':' || chr == '>')
return false;
for (int i = 0; i < str.size(); ++i) {
chr = str.charAt(i)
if (chr > 127 || chr == 0 || chr == 10 || chr == 13)
return false;
}
return chr != ' ';
}