sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [sling-org-apache-sling-feature-analyser] 27/28: User felix util manifest Parser instead of sling commons.osgi one.
Date Fri, 27 Apr 2018 09:53:43 GMT
This is an automated email from the ASF dual-hosted git repository.

davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git

commit 0024182c19535b96b8b646ebd14031cd8b76e8e4
Author: Karl Pauls <kpauls@adobe.com>
AuthorDate: Thu Apr 26 12:09:11 2018 +0200

    User felix util manifest Parser instead of sling commons.osgi one.
---
 pom.xml                                                       |  8 +-------
 .../analyser/task/impl/CheckBundlesForInitialContent.java     |  9 +++++----
 .../feature/analyser/task/impl/CheckBundlesForResources.java  | 11 ++++++-----
 3 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0241695..add7b59 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,7 +56,7 @@
                         <outputDirectory>${project.build.directory}/classes</outputDirectory>
                         <overWriteReleases>false</overWriteReleases>
                         <overWriteSnapshots>true</overWriteSnapshots>
-                        <includeArtifactIds>org.apache.felix.converter,org.apache.sling.feature,org.apache.sling.commons.johnzon,org.apache.sling.commons.osgi,osgi.core,slf4j-api,slf4j-simple</includeArtifactIds>
+                        <includeArtifactIds>org.apache.felix.converter,org.apache.sling.feature,org.apache.sling.commons.johnzon,osgi.core,slf4j-api,slf4j-simple</includeArtifactIds>
                     </configuration>
                 </execution>
             </executions>
@@ -126,12 +126,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
-            <artifactId>org.apache.sling.commons.osgi</artifactId>
-            <version>2.4.0</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.commons.johnzon</artifactId>
             <version>1.0.0</version>
             <scope>provided</scope>
diff --git a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForInitialContent.java
b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForInitialContent.java
index c45c2d7..d5e2360 100644
--- a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForInitialContent.java
+++ b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForInitialContent.java
@@ -18,7 +18,8 @@
  */
 package org.apache.sling.feature.analyser.task.impl;
 
-import org.apache.sling.commons.osgi.ManifestHeader;
+import org.apache.felix.utils.manifest.Clause;
+import org.apache.felix.utils.manifest.Parser;
 import org.apache.sling.feature.analyser.task.AnalyserTask;
 import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
 import org.apache.sling.feature.scanner.BundleDescriptor;
@@ -65,10 +66,10 @@ public class CheckBundlesForInitialContent implements AnalyserTask {
         if ( m != null ) {
             final String root =  m.getMainAttributes().getValue(CONTENT_HEADER);
             if (root != null) {
-                final ManifestHeader header = ManifestHeader.parse(root);
-                for (final ManifestHeader.Entry entry : header.getEntries()) {
+                Clause[] clauses = Parser.parseHeader(root);
+                for (final Clause entry :clauses) {
 
-                    String path = entry.getDirectiveValue(PATH_DIRECTIVE);
+                    String path = entry.getDirective(PATH_DIRECTIVE);
                     if (path == null) {
                         path = "/";
                     } else if (!path.startsWith("/")) {
diff --git a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForResources.java
b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForResources.java
index 92fe8db..545244e 100644
--- a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForResources.java
+++ b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckBundlesForResources.java
@@ -18,7 +18,8 @@
  */
 package org.apache.sling.feature.analyser.task.impl;
 
-import org.apache.sling.commons.osgi.ManifestHeader;
+import org.apache.felix.utils.manifest.Clause;
+import org.apache.felix.utils.manifest.Parser;
 import org.apache.sling.feature.analyser.task.AnalyserTask;
 import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
 import org.apache.sling.feature.scanner.BundleDescriptor;
@@ -64,10 +65,10 @@ public class CheckBundlesForResources implements AnalyserTask {
         if ( m != null ) {
             final String root =  m.getMainAttributes().getValue(BUNDLE_RESOURCE_ROOTS);
             if (root != null) {
-                final ManifestHeader header = ManifestHeader.parse(root);
-                for (final ManifestHeader.Entry entry : header.getEntries()) {
-                    final String resourceRoot = entry.getValue();
-                    final String pathDirective = entry.getDirectiveValue(PATH_DIRECTIVE);
+                Clause[] clauses = Parser.parseHeader(root);
+                for (final Clause entry : clauses) {
+                    final String resourceRoot = entry.getName();
+                    final String pathDirective = entry.getDirective(PATH_DIRECTIVE);
                     if (pathDirective != null) {
                         bundleResources.add(resourceRoot + "!" + pathDirective);
                     } else {

-- 
To stop receiving notification emails like this one, please contact
davidb@apache.org.

Mime
View raw message