Package aQute.bnd.osgi

Examples of aQute.bnd.osgi.Resource


                {
                    analyzer.getJar().putResource(entry.getKey(), entry.getValue());
                }

                // Insert the metatype resource, if any.
                Resource metaType = generator.getMetaTypeResource();
                if (metaType != null)
                {
                    analyzer.getJar().putResource("OSGI-INF/metatype/metatype.xml", metaType);
                }
            }
View Full Code Here


                {
                    addResource(entry.getKey(), entry.getValue().openInputStream());
                    jar.putResource(entry.getKey(), entry.getValue());
                }

                Resource metaType = generator.getMetaTypeResource();
                if (metaType != null)
                {
                    addResource("OSGI-INF/metatype/metatype.xml", metaType.openInputStream());
                    jar.putResource("OSGI-INF/metatype/metatype.xml", metaType);
                }

                // Possibly set the Import-Service/Export-Service header
                if (m_buildImportExportService)
View Full Code Here

            c.parseClassFileWithCollector(reader);
            if (reader.finish())
            {
                // And store the generated component descriptors in our resource list.
                String name = c.getFQN();
                Resource resource = createComponentResource(reader);
                m_resources.put("META-INF/dependencymanager/" + name, resource);
                annotationsFound = true;
               
                m_importService.addAll(reader.getImportService());
                m_exportService.addAll(reader.getExportService());
View Full Code Here

                            out.print("  ");
                            out.print(element);
                            String path = element;
                            if (name.length() != 0)
                                path = name + "/" + element;
                            Resource r = contents.get(path);
                            if (r != null) {
                                String extra = r.getExtra();
                                if (extra != null) {
                                    out.print(" extra='" + escapeUnicode(extra) + "'");
                                }
                            }
                            out.println();
View Full Code Here

        boolean printed = false;
        for (String path : clauses.keySet()) {
            printed = true;
            out.println(path);

            Resource r = jar.getResource(path);
            if (r != null) {
                InputStreamReader ir = new InputStreamReader(r.openInputStream(), Constants.DEFAULT_CHARSET);
                OutputStreamWriter or = new OutputStreamWriter(out, Constants.DEFAULT_CHARSET);
                try {
                    IO.copy(ir, or);
                } finally {
                    or.flush();
View Full Code Here

                            out.print("  ");
                            out.print(element);
                            String path = element;
                            if (name.length() != 0)
                                path = name + "/" + element;
                            Resource r = contents.get(path);
                            if (r != null) {
                                String extra = r.getExtra();
                                if (extra != null) {
                                    out.print(" extra='" + escapeUnicode(extra) + "'");
                                }
                            }
                            out.println();
View Full Code Here

        boolean printed = false;
        for (String path : clauses.keySet()) {
            printed = true;
            out.println(path);

            Resource r = jar.getResource(path);
            if (r != null) {
                InputStreamReader ir = new InputStreamReader(r.openInputStream(), Constants.DEFAULT_CHARSET);
                OutputStreamWriter or = new OutputStreamWriter(out, Constants.DEFAULT_CHARSET);
                try {
                    IO.copy(ir, or);
                } finally {
                    or.flush();
View Full Code Here

        PojoizationPlugin plugin = new PojoizationPlugin();

        Map<String, String> props = new HashMap<String, String>();
        props.put("include-embed-bundles", "true");

        Resource resource = new URLResource(getClass().getResource("/EMBED-MANIFEST.MF"));
        doReturn(dot).when(analyzer).getJar();
        doReturn(resource).when(embed).getResource(eq("META-INF/MANIFEST.MF"));
        analyzer.setClasspath(new Jar[] {embed});

        plugin.setReporter(reporter);
View Full Code Here

    public void testAnalysisWithExcludedEmbedComponents() throws Exception {
        PojoizationPlugin plugin = new PojoizationPlugin();

        Map<String, String> props = new HashMap<String, String>();

        Resource resource = new URLResource(getClass().getResource("/EMBED-MANIFEST.MF"));
        doReturn(dot).when(analyzer).getJar();
        doReturn(resource).when(embed).getResource(eq("META-INF/MANIFEST.MF"));
        analyzer.setClasspath(new Jar[] {embed});

        plugin.setReporter(reporter);
View Full Code Here

        PojoizationPlugin plugin = new PojoizationPlugin();

        Map<String, String> props = new HashMap<String, String>();
        props.put("include-embed-bundles", "true");

        Resource resource = new URLResource(getClass().getResource("/EMBED-MANIFEST.MF"));
        Resource resource2 = new URLResource(getClass().getResource("/metadata-components-only.xml"));
        doReturn(dot).when(analyzer).getJar();
        doReturn(resource).when(embed).getResource(eq("META-INF/MANIFEST.MF"));
        doReturn(resource2).when(dot).getResource(eq("META-INF/metadata.xml"));
        analyzer.setClasspath(new Jar[]{embed});
View Full Code Here

TOP

Related Classes of aQute.bnd.osgi.Resource

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.