// 参数为空 if (attList == null) { String[] args = { "attList"}; // 打印错误日志 StringBuffer msglog = new StringBuffer( "empty invoke parameter attList NULL "); log.error(msglog.toString()); throw new BaseException("error.common.parameter.empty", args); } // 参数为空 if (StringUtils.isEmpty(cn)) { String[] args = { "cn"}; // 打印错误日志 StringBuffer msglog = new StringBuffer( "empty invoke parameter cn NULL "); log.error(msglog.toString()); throw new BaseException("error.common.parameter.empty", args); }
// 为空,退出 if (attList.isEmpty()) { return; }
Attributes attrs = new BasicAttributes();
for (int i = 0; i < attList.size(); i++) { Attribute att = null; att = new BasicAttribute((String) attList.get(i)); // 加入 attrs.put(att); } context.modifyAttributes(cn, DirContext.REMOVE_ATTRIBUTE, attrs); // context.close(); } }