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 != ' ';
    }
    
posted @ 2012-09-01 13:16  luojunqiang  阅读(235)  评论(0编辑  收藏  举报