Hello,
I need to write an application which read the value from active directory "photo" attribut.I have to get the value of this attribut.
This value contains the path of the image file like:
" user_ou=users_ou=ham_ou=reu_dc=test-ad_dc=test.jpg"
My code is:
String searchFilter = "(&(objectClass=user)(" + searchPara + "=" + searchText + "))";
NamingEnumeration<SearchResult> search = ctx.search("DC=hsdg-ad,DC=int", searchFilter, searchControls);
while (search.hasMoreElements()) {
try {
User userData = new User();
result searchResult = search.nextElement();
String test = result.getAttributes().get(PHOTO).get().toString()
// hier I like to put this value into a String "test" but I get that like "*** test: [B@1569009"
}
}
Can somebody tell me how can I read the photo attribute value and get the value like " user_ou=users_ou=ham_ou=reu_dc=test-ad_dc=test.jpg"?
Thank you in advance!
I need to write an application which read the value from active directory "photo" attribut.I have to get the value of this attribut.
This value contains the path of the image file like:
" user_ou=users_ou=ham_ou=reu_dc=test-ad_dc=test.jpg"
My code is:
String searchFilter = "(&(objectClass=user)(" + searchPara + "=" + searchText + "))";
NamingEnumeration<SearchResult> search = ctx.search("DC=hsdg-ad,DC=int", searchFilter, searchControls);
while (search.hasMoreElements()) {
try {
User userData = new User();
result searchResult = search.nextElement();
String test = result.getAttributes().get(PHOTO).get().toString()
// hier I like to put this value into a String "test" but I get that like "*** test: [B@1569009"
}
}
Can somebody tell me how can I read the photo attribute value and get the value like " user_ou=users_ou=ham_ou=reu_dc=test-ad_dc=test.jpg"?
Thank you in advance!