Examples of ManifestContents


Examples of com.springsource.util.parser.manifest.ManifestContents

    }

    public static ManifestContents getManifest(Reader reader) {
        ManifestParser parser = new RecoveringManifestParser();
        try {
            ManifestContents manifest = parser.parse(reader);
            if (parser.foundProblems()) {
                for (ManifestProblem problem : parser.getProblems()) {
                    System.err.println(problem.toStringWithContext());
                    System.err.println();
                }
View Full Code Here

Examples of com.springsource.util.parser.manifest.ManifestContents

  public List<String> wrapModule(@NotNull Properties properties,
                                 @NotNull File inputJar,
                                 @NotNull File outputJar,
                                 @NotNull File manifestTemplate) throws OsgiBuildException {
    String inputPath = inputJar.getPath();
    ManifestContents manifest;

    try {
      PropertiesSource propertiesSource = new PropertiesPropertiesSource(properties);

      ManifestGenerator generator = new StandardManifestGenerator(DefaultManifestGeneratorContributorsFactory.create(propertiesSource));
      ClassPath classPath = new StandardClassPathFactory().create(inputPath);
      ManifestContents contents = new StandardManifestTemplateFactory().create(manifestTemplate.getPath(), null, null, null);
      manifest = generator.generate(contents, classPath);

      ManifestWriter manifestWriter = new StandardManifestWriterFactory().create(inputPath, outputJar.getPath());
      try {
        manifestWriter.write(manifest);
View Full Code Here

Examples of com.springsource.util.parser.manifest.ManifestContents

        this.manifestMerger = manifestMerger;
    }

    public ManifestContents generate(ManifestContents manifestTemplate, ClassPath... classPaths) {
        ReadablePartialManifest partialManifest = this.contributors.getReadablePartialManifest();
        ManifestContents existingManifest = getExistingManifest(classPaths);

        for (ManifestReader manifestReader : this.contributors.getManifestReaders()) {
            manifestReader.readJarManifest(existingManifest);
            manifestReader.readManifestTemplate(manifestTemplate);
        }

        for (ManifestModifier manifestModifier : this.contributors.getManifestModifiers()) {
            manifestModifier.modify(existingManifest);
        }

        for (ManifestTemplateModifier manifestTemplateModifier : this.contributors.getManifestTemplateModifiers()) {
            manifestTemplateModifier.modify(manifestTemplate);
        }

        analyzeEntries(classPaths, partialManifest);

        for (PartialManifestModifier partialManifestModifier : this.contributors.getPartialManifestModifiers()) {
            partialManifestModifier.modify(partialManifest);
        }

        ManifestContents contributedManifest = new SimpleManifestContents();
        for (ManifestContributor manifestContributor : this.contributors.getManifestContributors()) {
            manifestContributor.contribute(contributedManifest);
        }

        List<String> templateOnlyHeaderNames = new ArrayList<String>();
View Full Code Here

Examples of com.springsource.util.parser.manifest.ManifestContents

    }

    public ManifestContents merge(ManifestContents existingManifest, ManifestContents manifestTemplate, ManifestContents contributedManifest,
        ReadablePartialManifest partialManifest, List<String> templateOnlyHeaderNames) {

        ManifestContents manifest = new SimpleManifestContents();
        mergeManifests(manifest, existingManifest);
        mergeManifests(manifest, manifestTemplate);
        mergeManifests(manifest, contributedManifest);

        BundleManifest resolved = this.partialManifestResolver.resolve(manifestTemplate, partialManifest);
View Full Code Here

Examples of com.springsource.util.parser.manifest.ManifestContents

        }
    }

    private ManifestContents toManifestContents(BundleManifest bundleManifest) {
        Dictionary<String, String> headers = bundleManifest.toDictionary();
        ManifestContents manifest = new SimpleManifestContents(headers.get("Manifest-Version"));
        Map<String, String> attributes = manifest.getMainAttributes();

        Enumeration<String> headerNames = headers.keys();
        while (headerNames.hasMoreElements()) {
            String headerName = headerNames.nextElement();
            attributes.put(headerName, headers.get(headerName));
View Full Code Here

Examples of com.springsource.util.parser.manifest.ManifestContents

    private static final String BUNDLE_SYMBOLIC_NAME = "Bundle-SymbolicName";

    private static final String BUNDLE_VERSION = "Bundle-Version";

    public ManifestContents create(String manifestTemplatePath, String manifestTemplate, String bundleSymbolicName, String bundleVersion) {
        ManifestContents template;
        if (StringUtils.hasText(manifestTemplate)) {
            template = BundleManifestUtils.getManifest(new StringReader(manifestTemplate));
        } else if (StringUtils.hasText(manifestTemplatePath)) {
            template = BundleManifestUtils.getManifest(new File(manifestTemplatePath));
        } else {
            template = new SimpleManifestContents();
        }

        Map<String, String> attributes = template.getMainAttributes();
        if (StringUtils.hasText(bundleSymbolicName)) {
            attributes.put(BUNDLE_SYMBOLIC_NAME, bundleSymbolicName);
        }
        if (StringUtils.hasText(bundleVersion)) {
            attributes.put(BUNDLE_VERSION, bundleVersion);
View Full Code Here

Examples of com.springsource.util.parser.manifest.ManifestContents

    /**
     * {@inheritDoc}
     */
    public List<String> execute() {
        ManifestContents manifest = this.manifestGenerator.generate(this.manifestTemplate, this.inputClassPath);

        try {
            this.manifestWriter.write(manifest);
        } finally {
            this.manifestWriter.close();
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.