Hey Folks,
Just wondering if there is a way to clone a NamingEnumeration in Java? My program searches an LDAP server for people and it can take a few seconds to complete. To get the number of results I am using the following:
NamingEnumeration results = null;
NamingEnumeration results2 = null;
results = ctx.search("", "("+searchAt+"=" +searchVal +")", controls);
results2 = result;
int i = 0;
while(results2.hasMore())
{
results2.next();
i++;
}
But since results2 is just a reference to result when i go through displaying the results results.hasMore() will always return false.
is there a way to clone 'results' without having to re-preform the search and assign it to 'results2'?
Thanks, -Pete