Package org.apache.felix.bundlerepository

Examples of org.apache.felix.bundlerepository.Repository


                reqs.add(req);
                infos.put(req, bundleInfo);
            }
        }

        Repository repository = repositoryAdmin.getHelper().repository(ress.toArray(new Resource[ress.size()]));
        List<Repository> repos = new ArrayList<Repository>();
        repos.add(repositoryAdmin.getSystemRepository());
        repos.add(repositoryAdmin.getLocalRepository());
        repos.add(repository);
        repos.addAll(Arrays.asList(repositoryAdmin.listRepositories()));
View Full Code Here


            try
            {
                json.put( "status", true ); //$NON-NLS-1$
                json.put( "details", details ); //$NON-NLS-1$

                final Repository repositories[] = admin.listRepositories();
                for ( int i = 0; repositories != null && i < repositories.length; i++ )
                {
                    json.append( "repositories", new JSONObject() //$NON-NLS-1$
                        .put( "lastModified", repositories[i].getLastModified() ) //$NON-NLS-1$
                        .put( "name", repositories[i].getName() ) //$NON-NLS-1$
View Full Code Here

    final void doAction( String action, String urlParam ) throws IOException, ServletException
    {
        RepositoryAdmin admin = ( RepositoryAdmin ) getRepositoryAdmin();
        Repository[] repos = admin.listRepositories();
        Repository repo = getRepository( repos, urlParam );

        String uri = repo != null ? repo.getURI() : urlParam;

        if ( "delete".equals( action ) ) //$NON-NLS-1$
        {
            if ( !admin.removeRepository( uri ) )
            {
View Full Code Here

    public void testGetSizeFileResource() {
        ResourceImpl res = new ResourceImpl();
        res.put(Property.URI, "repo_files/test_file_3.jar");

        final URL dir = getClass().getResource("/repo_files");
        Repository repo = new RepositoryImpl() {
            { setURI(dir.toExternalForm()); }
        };
        res.setRepository(repo);

        assertEquals("Should have obtained the file size", 3, (long) res.getSize());
View Full Code Here

    public void testGetSizeNonExistentFileResource() {
        ResourceImpl res = new ResourceImpl();
        res.put(Property.URI, "repo_files/test_file_3_garbage.jar");

        final URL dir = getClass().getResource("/repo_files");
        Repository repo = new RepositoryImpl() {
            { setURI(dir.toExternalForm()); }
        };
        res.setRepository(repo);

        assertEquals("File size should be reported as 0", 0, (long) res.getSize());
View Full Code Here

        ResourceImpl res = new ResourceImpl();
        res.put(Property.URI, "jar:" + testFile4.toExternalForm() + "!/blah.txt");

        final URL dir = getClass().getResource("/repo_files");
        Repository repo = new RepositoryImpl() {
            { setURI(dir.toExternalForm()); }
        };
        res.setRepository(repo);

        assertEquals("Should have obtained the file size", 5, (long) res.getSize());
View Full Code Here

        ResourceImpl res = new ResourceImpl();
        res.put(Property.URI, "jar:" + testFile4.toExternalForm() + "!/blah_xyz.txt");

        final URL dir = getClass().getResource("/repo_files");
        Repository repo = new RepositoryImpl() {
            { setURI(dir.toExternalForm()); }
        };
        res.setRepository(repo);

        assertEquals("File size should be reported as 0", 0, (long) res.getSize());
View Full Code Here

          }
         
          /*
           * load repository in memory and extract APAM component metadata
           */
          Repository bundleRepository       = repoAdmin.getHelper().repository(repositoryLocation.toURL());
          ComponentRepository componentRepository = new ComponentRepository(this,bundleRepository);
         
          loadedBundleRepositories.add(repositoryLocation);
          repositories.put(repositoryLocation,componentRepository);
         
View Full Code Here

        Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
        clusterUrls.add(url);
        // update the OBR bundles in the cluster group
        Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
        synchronized (obrService) {
            Repository repository = obrService.addRepository(url);
            Resource[] resources = repository.getResources();
            for (Resource resource : resources) {
                ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString());
                bundles.add(info);
            }
            obrService.removeRepository(url);
View Full Code Here

        Set<String> clusterUrls = clusterManager.getSet(Constants.URLS_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
        clusterUrls.remove(url);
        // update the OBR bundles in the cluster group
        Set<ObrBundleInfo> bundles = clusterManager.getSet(Constants.BUNDLES_DISTRIBUTED_SET_NAME + Configurations.SEPARATOR + groupName);
        synchronized (obrService) {
            Repository repository = obrService.addRepository(url);
            Resource[] resources = repository.getResources();
            for (Resource resource : resources) {
                ObrBundleInfo info = new ObrBundleInfo(resource.getPresentationName(), resource.getSymbolicName(), resource.getVersion().toString());
                bundles.remove(info);
            }
            obrService.removeRepository(url);
View Full Code Here

TOP

Related Classes of org.apache.felix.bundlerepository.Repository

Copyright © 2018 www.massapicom. 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.