2010-10-01 29 views

回答

0

在LDAP通常刪除整個子樹是你只在測試中做一些事情......

無論如何,有一個在春天LDAP的測試utils的一個工具類叫做LdaptestUtils你想要的東西,那做。我不會在這裏複製代碼。看看http://www.jarvana.com/jarvana/view/org/springframework/ldap/spring-ldap/1.3.0.RELEASE/spring-ldap-1.3.0.RELEASE-sources.jar!/org/springframework/ldap/test/LdapTestUtils.java?format=ok

相關的方法名是clearSubContexts()(注意重載)。

0

如果您的服務器支持它,則需要使用javax.naming.ldap.TreeDelete控件,否則您別無選擇,只能手動進行深度優先。