Examples of ListableRepository


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 artifactSet = repository.list(artifactQuery);
                // if we have exactly one artifact found
                if (artifactSet.size() == 1) {
                    file = repository.getLocation((Artifact) 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((Artifact) artifactSet.last());
                    return file.getAbsoluteFile();
                }
            }
        }
       
View Full Code Here

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

            Set<Artifact> repo = new HashSet<Artifact>();
            repo.add(Artifact.create("geronimo/foo1/DEV/car"));
            repo.add(Artifact.create("geronimo/foo2/DEV/car"));
            repo.add(Artifact.create("geronimo/foo3/DEV/car"));
            repo.add(Artifact.create("geronimo/foo4/DEV/car"));
            ListableRepository mockRepository = new MockRepository(repo);
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.singleton(mockRepository), null);
            ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);
            AbstractName moduleName = naming.createRootName(environment.getConfigId(), "foo", "bar");
            DeploymentContext context = new DeploymentContext(outFile, null, environment, moduleName, ConfigurationModuleType.CAR, naming, configurationManager, Collections.singleton(mockRepository));
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.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

    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.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

       
        try {
            ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();    
            List moduleList=new ArrayList();
            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();
                    ModuleDetails module=new ModuleDetails(fileName);
                    moduleList.add(module);
                   
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

    public void execute() throws MojoExecutionException, MojoFailureException {
        String path = getArtifactRepository().getBasedir();
        File baseDir = new File(path);

        ListableRepository repository = new Maven2Repository(baseDir);
        try {
            PluginListType pluginList = createPluginListForRepositories(repository,  path);
            File outFile = new File(baseDir, "geronimo-plugins.xml");
            Writer out = new FileWriter(outFile, false);
            try {
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.