Revision 2447
Added by sgarg over 19 years ago
src/edu/ucsb/nceas/metacat/AuthLdap.java | ||
---|---|---|
449 | 449 |
ctls.setSearchScope(SearchControls.SUBTREE_SCOPE); |
450 | 450 |
//ctls.setCountLimit(1000); |
451 | 451 |
String filter = "(objectClass=inetOrgPerson)"; |
452 |
NamingEnumeration enum = ctx.search(ldapBase, filter, ctls);
|
|
452 |
NamingEnumeration namingEnum = ctx.search(ldapBase, filter, ctls);
|
|
453 | 453 |
|
454 | 454 |
// Store the users in a vector |
455 | 455 |
Vector uvec = new Vector(); |
... | ... | |
459 | 459 |
Vector umail = new Vector(); |
460 | 460 |
Attributes tempAttr = null; |
461 | 461 |
try { |
462 |
while (enum.hasMore()) {
|
|
463 |
SearchResult sr = (SearchResult) enum.next();
|
|
462 |
while (namingEnum.hasMore()) {
|
|
463 |
SearchResult sr = (SearchResult) namingEnum.next();
|
|
464 | 464 |
tempAttr = sr.getAttributes(); |
465 | 465 |
|
466 | 466 |
if ( (tempAttr.get("cn") + "").startsWith("cn: ")) { |
... | ... | |
646 | 646 |
filter = "(& " + gfilter + "(uniqueMember=" + foruser + "))"; |
647 | 647 |
} |
648 | 648 |
MetaCatUtil.debugMessage("searching for groups: " + filter, 35); |
649 |
NamingEnumeration enum = ctx.search(ldapBase, filter, ctls);
|
|
649 |
NamingEnumeration namingEnum = ctx.search(ldapBase, filter, ctls);
|
|
650 | 650 |
|
651 | 651 |
// Print the groups |
652 | 652 |
MetaCatUtil.debugMessage("getting group results.", 50); |
653 |
while (enum.hasMore()) {
|
|
654 |
SearchResult sr = (SearchResult) enum.next();
|
|
653 |
while (namingEnum.hasMore()) {
|
|
654 |
SearchResult sr = (SearchResult) namingEnum.next();
|
|
655 | 655 |
tempAttr = sr.getAttributes(); |
656 | 656 |
|
657 | 657 |
if ( (tempAttr.get("description") + "").startsWith("description: ")) { |
... | ... | |
716 | 716 |
} |
717 | 717 |
|
718 | 718 |
try { |
719 |
NamingEnumeration enum = dc.search(ldapBase, filter, ctls);
|
|
719 |
NamingEnumeration namingEnum = dc.search(ldapBase, filter, ctls);
|
|
720 | 720 |
// Print the groups |
721 |
while (enum.hasMore()) {
|
|
722 |
SearchResult sr = (SearchResult) enum.next();
|
|
721 |
while (namingEnum.hasMore()) {
|
|
722 |
SearchResult sr = (SearchResult) namingEnum.next();
|
|
723 | 723 |
tempAttr = sr.getAttributes(); |
724 | 724 |
|
725 | 725 |
if ( (tempAttr.get("description") + "").startsWith("description: ")) { |
... | ... | |
871 | 871 |
String filter = "(|(objectclass=organization)(objectclass=referral))"; |
872 | 872 |
|
873 | 873 |
// Search for objects in the current context |
874 |
NamingEnumeration enum = ctx.search("", filter, ctls);
|
|
874 |
NamingEnumeration namingEnum = ctx.search("", filter, ctls);
|
|
875 | 875 |
|
876 | 876 |
// Print the subtrees' <ldapURL, baseDN> |
877 |
while (enum.hasMore()) {
|
|
877 |
while (namingEnum.hasMore()) {
|
|
878 | 878 |
|
879 |
SearchResult sr = (SearchResult) enum.next();
|
|
879 |
SearchResult sr = (SearchResult) namingEnum.next();
|
|
880 | 880 |
|
881 | 881 |
Attributes attrs = sr.getAttributes(); |
882 | 882 |
NamingEnumeration enum1 = attrs.getAll(); // "dc" and "ref" attrs |
... | ... | |
962 | 962 |
Hashtable subtrees = getSubtrees(user, password, this.ldapUrl, |
963 | 963 |
this.ldapBase); |
964 | 964 |
|
965 |
Enumeration enum = subtrees.keys();
|
|
966 |
while (enum.hasMoreElements()) {
|
|
967 |
this.ldapBase = (String) enum.nextElement();
|
|
965 |
Enumeration keyEnum = subtrees.keys();
|
|
966 |
while (keyEnum.hasMoreElements()) {
|
|
967 |
this.ldapBase = (String) keyEnum.nextElement();
|
|
968 | 968 |
this.ldapUrl = (String) subtrees.get(ldapBase); |
969 | 969 |
|
970 | 970 |
/* |
src/com/arbortext/catalog/Catalog.java | ||
---|---|---|
449 | 449 |
try { |
450 | 450 |
base = new URL("file:///" + fixSlashes(fileName)); |
451 | 451 |
} catch (MalformedURLException e2) { |
452 |
debug(1, "Malformed URL on catalog filename",
|
|
452 |
debug(1, "Malformed URL on catalog filename", |
|
453 | 453 |
fixSlashes(fileName)); |
454 | 454 |
base = null; |
455 | 455 |
} |
... | ... | |
684 | 684 |
} |
685 | 685 |
|
686 | 686 |
// Parse all the DELEGATE catalogs |
687 |
Enumeration enum = catalogEntries.elements();
|
|
688 |
while (enum.hasMoreElements()) {
|
|
689 |
CatalogEntry e = (CatalogEntry) enum.nextElement();
|
|
687 |
Enumeration catalogEnum = catalogEntries.elements();
|
|
688 |
while (catalogEnum.hasMoreElements()) {
|
|
689 |
CatalogEntry e = (CatalogEntry) catalogEnum.nextElement();
|
|
690 | 690 |
if (e.entryType() == CatalogEntry.DELEGATE) { |
691 | 691 |
Catalog dcat = new Catalog(); |
692 | 692 |
dcat.setParserClass(parserClass); |
... | ... | |
740 | 740 |
|
741 | 741 |
// If there's a DOCTYPE entry in this catalog, use it |
742 | 742 |
boolean over = default_override; |
743 |
Enumeration enum = catalogEntries.elements();
|
|
744 |
while (enum.hasMoreElements()) {
|
|
745 |
CatalogEntry e = (CatalogEntry) enum.nextElement();
|
|
743 |
Enumeration catalogEnum = catalogEntries.elements();
|
|
744 |
while (catalogEnum.hasMoreElements()) {
|
|
745 |
CatalogEntry e = (CatalogEntry) catalogEnum.nextElement();
|
|
746 | 746 |
if (e.entryType() == CatalogEntry.OVERRIDE) { |
747 | 747 |
over = e.yes_or_no().equalsIgnoreCase("YES"); |
748 | 748 |
continue; |
... | ... | |
775 | 775 |
public String resolveDocument() |
776 | 776 |
throws MalformedURLException, IOException { |
777 | 777 |
// If there's a DOCUMENT entry, return it |
778 |
Enumeration enum = catalogEntries.elements();
|
|
779 |
while (enum.hasMoreElements()) {
|
|
780 |
CatalogEntry e = (CatalogEntry) enum.nextElement();
|
|
778 |
Enumeration catalogEnum = catalogEntries.elements();
|
|
779 |
while (catalogEnum.hasMoreElements()) {
|
|
780 |
CatalogEntry e = (CatalogEntry) catalogEnum.nextElement();
|
|
781 | 781 |
if (e.entryType() == CatalogEntry.DOCUMENT) { |
782 | 782 |
return e.formalSystemIdentifier(); |
783 | 783 |
} |
... | ... | |
830 | 830 |
|
831 | 831 |
// If there's a ENTITY entry in this catalog, use it |
832 | 832 |
boolean over = default_override; |
833 |
Enumeration enum = catalogEntries.elements();
|
|
834 |
while (enum.hasMoreElements()) {
|
|
835 |
CatalogEntry e = (CatalogEntry) enum.nextElement();
|
|
833 |
Enumeration catalogEnum = catalogEntries.elements();
|
|
834 |
while (catalogEnum.hasMoreElements()) {
|
|
835 |
CatalogEntry e = (CatalogEntry) catalogEnum.nextElement();
|
|
836 | 836 |
if (e.entryType() == CatalogEntry.OVERRIDE) { |
837 | 837 |
over = e.yes_or_no().equalsIgnoreCase("YES"); |
838 | 838 |
continue; |
... | ... | |
896 | 896 |
|
897 | 897 |
// If there's a NOTATION entry in this catalog, use it |
898 | 898 |
boolean over = default_override; |
899 |
Enumeration enum = catalogEntries.elements();
|
|
900 |
while (enum.hasMoreElements()) {
|
|
901 |
CatalogEntry e = (CatalogEntry) enum.nextElement();
|
|
899 |
Enumeration catalogEnum = catalogEntries.elements();
|
|
900 |
while (catalogEnum.hasMoreElements()) {
|
|
901 |
CatalogEntry e = (CatalogEntry) catalogEnum.nextElement();
|
|
902 | 902 |
if (e.entryType() == CatalogEntry.OVERRIDE) { |
903 | 903 |
over = e.yes_or_no().equalsIgnoreCase("YES"); |
904 | 904 |
continue; |
... | ... | |
942 | 942 |
* match is not found in the catalog, instead null is returned |
943 | 943 |
* to indicate that no match was found. |
944 | 944 |
*/ |
945 |
public String resolvePublic(String publicId, String systemId)
|
|
945 |
public String resolvePublic(String publicId, String systemId) |
|
946 | 946 |
throws MalformedURLException, IOException { |
947 | 947 |
|
948 | 948 |
// If there's a SYSTEM entry in this catalog, use it |
... | ... | |
1036 | 1036 |
|
1037 | 1037 |
// If there's a PUBLIC entry in this catalog, use it |
1038 | 1038 |
boolean over = default_override; |
1039 |
Enumeration enum = catalogEntries.elements();
|
|
1040 |
while (enum.hasMoreElements()) {
|
|
1041 |
CatalogEntry e = (CatalogEntry) enum.nextElement();
|
|
1039 |
Enumeration catalogEnum = catalogEntries.elements();
|
|
1040 |
while (catalogEnum.hasMoreElements()) {
|
|
1041 |
CatalogEntry e = (CatalogEntry) catalogEnum.nextElement();
|
|
1042 | 1042 |
if (e.entryType() == CatalogEntry.OVERRIDE) { |
1043 | 1043 |
over = e.yes_or_no().equalsIgnoreCase("YES"); |
1044 | 1044 |
continue; |
... | ... | |
1054 | 1054 |
|
1055 | 1055 |
// If there's a DELEGATE entry in this catalog, use it |
1056 | 1056 |
over = default_override; |
1057 |
enum = catalogEntries.elements();
|
|
1057 |
catalogEnum = catalogEntries.elements();
|
|
1058 | 1058 |
Vector delCats = new Vector(); |
1059 |
while (enum.hasMoreElements()) {
|
|
1060 |
CatalogEntry e = (CatalogEntry) enum.nextElement();
|
|
1059 |
while (catalogEnum.hasMoreElements()) {
|
|
1060 |
CatalogEntry e = (CatalogEntry) catalogEnum.nextElement();
|
|
1061 | 1061 |
if (e.entryType() == CatalogEntry.OVERRIDE) { |
1062 | 1062 |
over = e.yes_or_no().equalsIgnoreCase("YES"); |
1063 | 1063 |
continue; |
Also available in: Unified diff
Removed occurence of enum which is a keyword in Java 1.5