Package org.apache.felix.bundlerepository.impl

Examples of org.apache.felix.bundlerepository.impl.DataModelHelperImpl$Headers


          log("map.get(" + key + ") = " + obj);
      if (obj == null) {
        resp.sendError(404, "Not here: " + e);
        return;
      }
      Headers h = new Headers();
      h = h.mergeMetadata(obj.getMetadata());
      for (Map.Entry<String, List<String>> me : h.getHeaders().entrySet()) {
        for (String v : me.getValue()) {
          resp.setHeader(me.getKey(), v);
        }
      }
      resp.getOutputStream().write(obj.getData());
View Full Code Here


          break;
        os.write(b, 0, len);
      }
      S3Object s3 = new S3Object(os.toByteArray());
      map.put(e, s3);
      Headers h = new Headers();
      @SuppressWarnings("unchecked")
      Enumeration<String> names = req.getHeaderNames();
      for (String n : Collections.list(names))
        h.put(n, req.getHeader(n));
      s3.setMetadata(h.extractMetadata());
      log("put '" + e + "' as: " + s3);
    }
  }
View Full Code Here

        final ObrResolver obrResolver = new ObrResolver();
        obrResolver.setRepositoryAdmin(admin);

        final Capture<Requirement> captureReq = new Capture<Requirement>();

        expect(admin.getHelper()).andReturn(new DataModelHelperImpl()).anyTimes();
        expect(admin.getSystemRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.getLocalRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.listRepositories()).andReturn(new org.apache.felix.bundlerepository.Repository[0]);
        expect(admin.resolver(EasyMock.<org.apache.felix.bundlerepository.Repository[]>anyObject())).andReturn(resolver);
        resolver.add(EasyMock.capture(captureReq));
View Full Code Here

            log.info( "URL template: " + urlTemplate );

            List<File> files = new ArrayList<File>();
            findAllJars( new File( repo ), files );

            DataModelHelperImpl dmh = new DataModelHelperImpl();
            RepositoryImpl repository;

            File obrRepoFile = new File( repositoryXml );
            if ( obrRepoFile.isFile() )
            {
                repository = ( RepositoryImpl ) dmh.repository( repositoryXml.toURL() );
            }
            else
            {
                repository = new RepositoryImpl();
            }

            for ( File file : files )
            {
                try
                {
                    ResourceImpl resource = ( ResourceImpl ) dmh.createResource( file.toURI().toURL() );
                    if ( resource != null )
                    {
                        repository.addResource( resource );
                        doTemplate( mavenRepoUri, file, resource );
                        log.info( "Adding resource: " + file );
                    }
                    else
                    {
                        log.info( "Ignoring non OSGi bundle: " + file );
                    }
                }
                catch ( Exception e )
                {
                    log.warn( "Error processing bundle: " + file + " " + e.getMessage() );
                }
            }
            Writer writer = new FileWriter( obrRepoFile );
            try
            {
                dmh.writeRepository( repository, writer );
            }
            finally
            {
                writer.close();
            }
View Full Code Here

                m_logger.info( "Installing " + resourceURI );
            }

            try
            {
                m_resourceBundle = ( ResourceImpl ) new DataModelHelperImpl().createResource( bundleFile.toURI().toURL() );
                if ( m_resourceBundle == null )
                {
                    return;
                }
            }
View Full Code Here

            throw new MojoExecutionException( "Unable to write to file: " + file.getName() + " : " + e.getMessage() );
        }

        try
        {
            new DataModelHelperImpl().writeRepository( m_repository, writer );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Unable to write repository xml", e );
        }
View Full Code Here

        }
        else
        {
            try
            {
                m_repository = ( RepositoryImpl ) new DataModelHelperImpl().repository( m_repositoryXml.toURL() );
                if ( setURI != null )
                {
                    setURI.invoke( m_repository, ( String ) null );
                }
            }
View Full Code Here

        final ObrResolver obrResolver = new ObrResolver();
        obrResolver.setRepositoryAdmin(admin);

        final Capture<Requirement> captureReq = new Capture<Requirement>();

        expect(admin.getHelper()).andReturn(new DataModelHelperImpl()).anyTimes();
        expect(admin.getSystemRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.getLocalRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.listRepositories()).andReturn(new org.apache.felix.bundlerepository.Repository[0]);
        expect(admin.resolver(EasyMock.<org.apache.felix.bundlerepository.Repository[]>anyObject())).andReturn(resolver);
        resolver.add(EasyMock.capture(captureReq));
View Full Code Here

        obrResolver.setRepositoryAdmin(admin);
        obrResolver.setResolveOptionalImports(true);

        final Capture<Requirement> captureReq = new Capture<Requirement>();

        expect(admin.getHelper()).andReturn(new DataModelHelperImpl()).anyTimes();
        expect(admin.getSystemRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.getLocalRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.listRepositories()).andReturn(new org.apache.felix.bundlerepository.Repository[0]);
        expect(admin.resolver(EasyMock.<org.apache.felix.bundlerepository.Repository[]>anyObject())).andReturn(resolver);
        resolver.add(EasyMock.capture(captureReq));
View Full Code Here

        final ObrResolver obrResolver = new ObrResolver();
        obrResolver.setRepositoryAdmin(admin);

        final Capture<Requirement> captureReq = new Capture<Requirement>();

        expect(admin.getHelper()).andReturn(new DataModelHelperImpl()).anyTimes();
        expect(admin.getSystemRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.getLocalRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.listRepositories()).andReturn(new org.apache.felix.bundlerepository.Repository[0]);
        expect(admin.resolver(EasyMock.<org.apache.felix.bundlerepository.Repository[]>anyObject())).andReturn(resolver);
        resolver.add(EasyMock.capture(captureReq));
View Full Code Here

TOP

Related Classes of org.apache.felix.bundlerepository.impl.DataModelHelperImpl$Headers

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.