Examples of ListableRepository


Examples of org.apache.geronimo.kernel.repository.ListableRepository

    private void loadRARList(RenderRequest renderRequest) {
        // List the available RARs
        List list = new ArrayList();
        ListableRepository[] repos = PortletManager.getCurrentServer(renderRequest).getRepositories();
        for (int i = 0; i < repos.length; i++) {
            ListableRepository repo = repos[i];
            final SortedSet artifacts = repo.list();
            outer:
            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
              Artifact artifact = (Artifact)iterator.next();
                String test = artifact.toString();
                if (!test.endsWith("/rar")) { //todo: may need to change this logic if configId format changes
                    continue;
                } else if (repo.getLocation(artifact).isDirectory()) {
                  continue;
                }
                for (int k = 0; k < SKIP_RARS_CONTAINING.length; k++) {
                    String skip = SKIP_RARS_CONTAINING[k];
                    if (test.indexOf(skip) > -1) {
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

        if (data.jar != null && !data.jar.equals("")) {
            try {
                Artifact one = Artifact.create(data.getJar());
                ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
                for (int i = 0; i < repos.length; i++) {
                    ListableRepository repo = repos[i];
                    File file = repo.getLocation(one);
                    if (file != null) {
                        loader = new URLClassLoader(new URL[]{file.toURI().toURL()}, loader);
                        break;
                    }
                }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

    private void loadDriverJARList(RenderRequest renderRequest) {
        // List the available JARs
        List list = new ArrayList();
        ListableRepository[] repos = PortletManager.getCurrentServer(renderRequest).getRepositories();
        for (int i = 0; i < repos.length; i++) {
            ListableRepository repo = repos[i];

            SortedSet artifacts = repo.list();
            outer:
            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
                Artifact artifact = (Artifact) iterator.next();
                String test = artifact.toString();
                // todo should only test groupId and should check for long (org.apache.geronimo) and short form
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

            repo.put(Artifact.create("geronimo/foo1/DEV/jar"), file);
            repo.put(Artifact.create("geronimo/foo2/DEV/jar"), file);
            repo.put(Artifact.create("geronimo/foo3/DEV/car"), file);
            repo.put(Artifact.create("geronimo/foo4/DEV/car"), file);

            ListableRepository mockRepository = new MockRepository(repo);
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, mockRepository);
            ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET, bundleContext);
            bundleContext.setConfigurationManager(configurationManager);
            AbstractName moduleName = naming.createRootName(environment.getConfigId(), "foo", "bar");
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

            outputPath.mkdirs();
            new File(outputPath, "war").mkdir();
            File path = new File(BASEDIR, "src/test/resources/deployables/" + appName);
            UnpackedJarFile jarFile = new UnpackedJarFile(path);
            Module module = builder.createModule(null, jarFile, kernel.getNaming(), new ModuleIDBuilder());
            ListableRepository repository = null;

            moduleName = module.getModuleName();
            EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
            module.setEarContext(earContext);
            module.setRootEarContext(earContext);
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

        // org.apache.geronimo.console.repository.RepositoryViewPortlet.doView()
        // TODO need to eliminate this duplicate code probably by putting it in a common place
        List<String> list = new ArrayList<String>();
        ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
        for (int i = 0; i < repos.length; i++) {
            ListableRepository repo = repos[i];
            for (Iterator<Artifact> iterator = repo.list().iterator(); iterator.hasNext();) {
                String fileName = iterator.next().toString();
                list.add(fileName);
            }
        }
        return list;
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

    private static File getLocation(Collection<? extends Repository> repositories, Artifact artifactQuery) throws Exception {
        File file = null;

        for (Repository arepository : repositories) {
            if (arepository instanceof ListableRepository) {
                ListableRepository repository = (ListableRepository) arepository;
                SortedSet<Artifact> artifactSet = repository.list(artifactQuery);
                // if we have exactly one artifact found
                if (artifactSet.size() == 1) {
                    file = repository.getLocation(artifactSet.first());
                    return file.getAbsoluteFile();
                } else if (artifactSet.size() > 1) {// if we have more than 1 artifacts found use the latest one.
                    file = repository.getLocation(artifactSet.last());
                    return file.getAbsoluteFile();
                }
            }
        }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

            gbean3newer = configurationData3newer.addGBean("gbean3", TestBean.getGBeanInfo()).getAbstractName();
            configStore.install(configurationData3newer);
            configurations.put(artifact3NoVersion, configurationData3newer);
        }

        ListableRepository testRepository = new MockRepository(configurations.keySet());
        DefaultArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, testRepository);

        configurationManager = new KernelConfigurationManager(kernel,
                Collections.singleton(configStore),
                null,
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

    public List getDependencies(PortletRequest request) {
        ListableRepository[] repo = PortletManager.getCurrentServer(request).getRepositories();
        List dependencies = new ArrayList();
        for (int i = 0; i < repo.length; i++) {
            ListableRepository repository = repo[i];
            SortedSet artifacts = repository.list();
            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
                Artifact artifact = (Artifact) iterator.next();
                dependencies.add(artifact.toString());
            }
        }
View Full Code Here

Examples of org.apache.geronimo.kernel.repository.ListableRepository

            return dependencyTree;
        }
        session.removeAttribute(DependencyViewPortlet.Server_Key);
        ListableRepository[] repos = server.getRepositories();
        for (int i = 0; i < repos.length; i++) {
            ListableRepository repo = repos[i];
            final SortedSet artifacts = repo.list();
            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
                String fileName = iterator.next().toString();
                treeRepo.addChild(new TreeEntry(fileName, NORMAL_TYPE));
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.