This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.commons.osgi-2.0.2-incubator in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-osgi.git
commit 36986a1e4a82d9f506f0499d4aad616a487df501 Author: Carsten Ziegeler <[email protected]> AuthorDate: Thu May 15 07:30:37 2008 +0000 Use new manifest parser in content loader. git-svn-id: https://svn.apache.org/repos/asf/incubator/sling/trunk/commons/osgi@656528 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 5 ++++ .../apache/sling/commons/osgi/ManifestHeader.java | 29 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ce3675..cf0b96b 100644 --- a/pom.xml +++ b/pom.xml @@ -83,6 +83,11 @@ <groupId>org.apache.felix</groupId> <artifactId>org.osgi.compendium</artifactId> </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> </dependencies> </project> diff --git a/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java b/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java index f7a7e85..039bdda 100644 --- a/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java +++ b/src/main/java/org/apache/sling/commons/osgi/ManifestHeader.java @@ -47,7 +47,11 @@ public class ManifestHeader { * The directives for this entry. */ NameValuePair[] getDirectives(); - } + + String getAttributeValue(String name); + + String getDirectiveValue(String name); +} /** The entries for this header. */ private Entry[] entries = new Entry[0]; @@ -305,5 +309,28 @@ public class ManifestHeader { return this.value; } + public String getAttributeValue(String name) { + String v = null; + int index = 0; + while ( v == null && index < attributes.length ) { + if ( attributes[index].getName().equals(name) ) { + v = attributes[index].getValue(); + } + index++; + } + return v; + } + + public String getDirectiveValue(String name) { + String v = null; + int index = 0; + while ( v == null && index < directives.length ) { + if ( directives[index].getName().equals(name) ) { + v = directives[index].getValue(); + } + index++; + } + return v; + } } } -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
