edu.internet2.middleware.grouper.app.gsh.FindImports Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grouper Show documentation
Show all versions of grouper Show documentation
Internet2 Groups Management Toolkit
package edu.internet2.middleware.grouper.app.gsh;
import java.io.File;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.lang.StringUtils;
import edu.internet2.middleware.grouper.util.GrouperUtil;
/**
* this is too much of a performance penalty
*/
public class FindImports {
public static void main(String[] args) {
// /Users/mchyzer/git/grouper_v2_5/grouper
File thisDir = new File("");
Set packages = new TreeSet();
addFromDir(packages, new File(thisDir.getAbsolutePath() + File.separator + "src" + File.separator + "grouper"));
addFromDir(packages, new File(new File(thisDir.getAbsolutePath()).getParentFile().getAbsolutePath() + File.separator + "grouper-ui" + File.separator + "java" + File.separator + "src"));
addFromDir(packages, new File(new File(thisDir.getAbsolutePath()).getParentFile().getAbsolutePath() + File.separator + "grouper-misc" + File.separator + "grouperClient" + File.separator + "src" + File.separator + "java"));
Iterator iterator = packages.iterator();
while(iterator.hasNext()) {
String thePackage = iterator.next();
if (!thePackage.startsWith("edu") || thePackage.startsWith("edu.upenn")
|| thePackage.equals("edu") || thePackage.equals("edu.internet2") || thePackage.equals("edu.internet2.middleware")
// this is redundant but really where we want to be
|| !thePackage.startsWith("edu.internet2.middleware")) {
iterator.remove();
}
}
// GrouperShell line 503 is the old GSH... dont adjust that
for (String thePackage : packages) {
System.out.println("\"" + thePackage + "\",");
}
System.out.println("\n\n");
for (String thePackage : packages) {
System.out.println("import " + thePackage + ".*");
}
}
/**
* all packages in client, api, and ui, sorted, filtered, imports for GSH, generated by FindImports.main()
*/
public static final String[] ALL_PACKAGES = new String[] {
"edu.internet2.middleware.grouper",
"edu.internet2.middleware.grouper.annotations",
"edu.internet2.middleware.grouper.app",
"edu.internet2.middleware.grouper.app.attestation",
"edu.internet2.middleware.grouper.app.deprovisioning",
"edu.internet2.middleware.grouper.app.file",
"edu.internet2.middleware.grouper.app.graph",
"edu.internet2.middleware.grouper.app.grouperTypes",
"edu.internet2.middleware.grouper.app.gsh",
"edu.internet2.middleware.grouper.app.gsh.jline",
"edu.internet2.middleware.grouper.app.ldapProvisioning",
"edu.internet2.middleware.grouper.app.ldapProvisioning.ldapSyncDao",
"edu.internet2.middleware.grouper.app.loader",
"edu.internet2.middleware.grouper.app.loader.db",
"edu.internet2.middleware.grouper.app.loader.ldap",
"edu.internet2.middleware.grouper.app.messaging",
"edu.internet2.middleware.grouper.app.provisioning",
"edu.internet2.middleware.grouper.app.reports",
"edu.internet2.middleware.grouper.app.serviceLifecycle",
"edu.internet2.middleware.grouper.app.tableSync",
"edu.internet2.middleware.grouper.app.upgradeTasks",
"edu.internet2.middleware.grouper.app.usdu",
"edu.internet2.middleware.grouper.app.visualization",
"edu.internet2.middleware.grouper.app.workflow",
"edu.internet2.middleware.grouper.attr",
"edu.internet2.middleware.grouper.attr.assign",
"edu.internet2.middleware.grouper.attr.finder",
"edu.internet2.middleware.grouper.attr.value",
"edu.internet2.middleware.grouper.audit",
"edu.internet2.middleware.grouper.authentication",
"edu.internet2.middleware.grouper.bench",
"edu.internet2.middleware.grouper.cache",
"edu.internet2.middleware.grouper.cfg",
"edu.internet2.middleware.grouper.cfg.dbConfig",
"edu.internet2.middleware.grouper.cfg.text",
"edu.internet2.middleware.grouper.changeLog",
"edu.internet2.middleware.grouper.changeLog.consumer",
"edu.internet2.middleware.grouper.changeLog.esb",
"edu.internet2.middleware.grouper.changeLog.esb.consumer",
"edu.internet2.middleware.grouper.client",
"edu.internet2.middleware.grouper.ddl",
"edu.internet2.middleware.grouper.ddl.ddlutils",
"edu.internet2.middleware.grouper.eg",
"edu.internet2.middleware.grouper.entity",
"edu.internet2.middleware.grouper.esb",
"edu.internet2.middleware.grouper.esb.listener",
"edu.internet2.middleware.grouper.exception",
"edu.internet2.middleware.grouper.externalSubjects",
"edu.internet2.middleware.grouper.filter",
"edu.internet2.middleware.grouper.group",
"edu.internet2.middleware.grouper.grouperSet",
"edu.internet2.middleware.grouper.grouperUi",
"edu.internet2.middleware.grouper.grouperUi.beans",
"edu.internet2.middleware.grouper.grouperUi.beans.api",
"edu.internet2.middleware.grouper.grouperUi.beans.api.deprovisioning",
"edu.internet2.middleware.grouper.grouperUi.beans.api.objectTypes",
"edu.internet2.middleware.grouper.grouperUi.beans.api.provisioning",
"edu.internet2.middleware.grouper.grouperUi.beans.attributeDefNamePicker",
"edu.internet2.middleware.grouper.grouperUi.beans.attributeNameUpdate",
"edu.internet2.middleware.grouper.grouperUi.beans.attributeUpdate",
"edu.internet2.middleware.grouper.grouperUi.beans.config",
"edu.internet2.middleware.grouper.grouperUi.beans.dojo",
"edu.internet2.middleware.grouper.grouperUi.beans.externalSubjectSelfRegister",
"edu.internet2.middleware.grouper.grouperUi.beans.groupUpdate",
"edu.internet2.middleware.grouper.grouperUi.beans.inviteExternalSubjects",
"edu.internet2.middleware.grouper.grouperUi.beans.json",
"edu.internet2.middleware.grouper.grouperUi.beans.permissionUpdate",
"edu.internet2.middleware.grouper.grouperUi.beans.preferences",
"edu.internet2.middleware.grouper.grouperUi.beans.simpleMembershipUpdate",
"edu.internet2.middleware.grouper.grouperUi.beans.subjectPicker",
"edu.internet2.middleware.grouper.grouperUi.beans.tree",
"edu.internet2.middleware.grouper.grouperUi.beans.ui",
"edu.internet2.middleware.grouper.grouperUi.csrf",
"edu.internet2.middleware.grouper.grouperUi.serviceLogic",
"edu.internet2.middleware.grouper.hibernate",
"edu.internet2.middleware.grouper.hooks",
"edu.internet2.middleware.grouper.hooks.beans",
"edu.internet2.middleware.grouper.hooks.examples",
"edu.internet2.middleware.grouper.hooks.logic",
"edu.internet2.middleware.grouper.instrumentation",
"edu.internet2.middleware.grouper.internal",
"edu.internet2.middleware.grouper.internal.dao",
"edu.internet2.middleware.grouper.internal.dao.hib3",
"edu.internet2.middleware.grouper.internal.util",
"edu.internet2.middleware.grouper.j2ee",
"edu.internet2.middleware.grouper.j2ee.status",
"edu.internet2.middleware.grouper.ldap",
"edu.internet2.middleware.grouper.ldap.handler",
"edu.internet2.middleware.grouper.ldap.ldaptive",
"edu.internet2.middleware.grouper.ldap.vtldap",
"edu.internet2.middleware.grouper.log",
"edu.internet2.middleware.grouper.member",
"edu.internet2.middleware.grouper.membership",
"edu.internet2.middleware.grouper.messaging",
"edu.internet2.middleware.grouper.misc",
"edu.internet2.middleware.grouper.permissions",
"edu.internet2.middleware.grouper.permissions.limits",
"edu.internet2.middleware.grouper.permissions.limits.impl",
"edu.internet2.middleware.grouper.permissions.role",
"edu.internet2.middleware.grouper.pit",
"edu.internet2.middleware.grouper.pit.finder",
"edu.internet2.middleware.grouper.privs",
"edu.internet2.middleware.grouper.registry",
"edu.internet2.middleware.grouper.rules",
"edu.internet2.middleware.grouper.rules.beans",
"edu.internet2.middleware.grouper.service",
"edu.internet2.middleware.grouper.session",
"edu.internet2.middleware.grouper.stem",
"edu.internet2.middleware.grouper.subj",
"edu.internet2.middleware.grouper.subj.cache",
"edu.internet2.middleware.grouper.subj.decoratorExamples",
"edu.internet2.middleware.grouper.tableIndex",
"edu.internet2.middleware.grouper.ui",
"edu.internet2.middleware.grouper.ui.actions",
"edu.internet2.middleware.grouper.ui.customUi",
"edu.internet2.middleware.grouper.ui.exceptions",
"edu.internet2.middleware.grouper.ui.hooks",
"edu.internet2.middleware.grouper.ui.tags",
"edu.internet2.middleware.grouper.ui.tags.menu",
"edu.internet2.middleware.grouper.ui.util",
"edu.internet2.middleware.grouper.userData",
"edu.internet2.middleware.grouper.util",
"edu.internet2.middleware.grouper.validator",
"edu.internet2.middleware.grouper.ws",
"edu.internet2.middleware.grouper.xml",
"edu.internet2.middleware.grouper.xml.export",
"edu.internet2.middleware.grouper.xml.importXml",
"edu.internet2.middleware.grouper.xml.userAudit",
"edu.internet2.middleware.grouper.xmpp",
"edu.internet2.middleware.grouperClient",
"edu.internet2.middleware.grouperClient.api",
"edu.internet2.middleware.grouperClient.collections",
"edu.internet2.middleware.grouperClient.commandLine",
"edu.internet2.middleware.grouperClient.config",
"edu.internet2.middleware.grouperClient.config.db",
"edu.internet2.middleware.grouperClient.discovery",
"edu.internet2.middleware.grouperClient.encryption",
"edu.internet2.middleware.grouperClient.examples",
"edu.internet2.middleware.grouperClient.failover",
"edu.internet2.middleware.grouperClient.jdbc",
"edu.internet2.middleware.grouperClient.jdbc.tableSync",
"edu.internet2.middleware.grouperClient.messaging",
"edu.internet2.middleware.grouperClient.messaging.security",
"edu.internet2.middleware.grouperClient.ssl",
"edu.internet2.middleware.grouperClient.util",
"edu.internet2.middleware.grouperClient.ws",
"edu.internet2.middleware.grouperClient.ws.beans",
"edu.internet2.middleware.grouperClientExt",
"edu.internet2.middleware.grouperClientExt.edu",
"edu.internet2.middleware.grouperClientExt.edu.internet2",
"edu.internet2.middleware.grouperClientExt.edu.internet2.middleware",
"edu.internet2.middleware.grouperClientExt.edu.internet2.middleware.grouperClientMail",
"edu.internet2.middleware.grouperClientExt.edu.internet2.middleware.morphString",
"edu.internet2.middleware.grouperClientExt.util",
"edu.internet2.middleware.grouperClientExt.xmpp",
"edu.internet2.middleware.morphString",
"edu.internet2.middleware.subject",
"edu.internet2.middleware.subject.config",
"edu.internet2.middleware.subject.provider",
"edu.internet2.middleware.subject.util"
};
private static void addFromDir(Set packages, File parentDir) {
Set allDirs = GrouperUtil.fileDescendantDirsRelativePaths(parentDir);
for (String theDir : allDirs) {
theDir = StringUtils.replace(theDir, "/", ".");
theDir = StringUtils.replace(theDir, "\\", ".");
packages.add(theDir);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy