Package org.ops4j.pax.swissbox.bnd
Class BndUtils
- java.lang.Object
-
- org.ops4j.pax.swissbox.bnd.BndUtils
-
public class BndUtils extends Object
Wrapper over PeterK's bnd lib.- Since:
- 0.1.0, January 14, 2008
- Author:
- Alin Dreghiciu
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static InputStreamcreateBundle(InputStream jarInputStream, Properties instructions, String jarInfo)Processes the input jar and generates the necessary OSGi headers using specified instructions.static InputStreamcreateBundle(InputStream jarInputStream, Properties instructions, String jarInfo, OverwriteMode overwriteMode)Processes the input jar and generates the necessary OSGi headers using specified instructions.static PropertiesparseInstructions(String query)Parses bnd instructions out of an url query string.
-
-
-
Method Detail
-
createBundle
public static InputStream createBundle(InputStream jarInputStream, Properties instructions, String jarInfo) throws IOException
Processes the input jar and generates the necessary OSGi headers using specified instructions.- Parameters:
jarInputStream- input stream for the jar to be processed. Cannot be null.instructions- bnd specific processing instructions. Cannot be null.jarInfo- information about the jar to be processed. Usually the jar url. Cannot be null or empty.- Returns:
- an input stream for the generated bundle
- Throws:
org.ops4j.lang.NullArgumentException- if any of the parameters is nullIOException- re-thron during jar processing
-
createBundle
public static InputStream createBundle(InputStream jarInputStream, Properties instructions, String jarInfo, OverwriteMode overwriteMode) throws IOException
Processes the input jar and generates the necessary OSGi headers using specified instructions.- Parameters:
jarInputStream- input stream for the jar to be processed. Cannot be null.instructions- bnd specific processing instructions. Cannot be null.jarInfo- information about the jar to be processed. Usually the jar url. Cannot be null or empty.overwriteMode- manifets overwrite mode- Returns:
- an input stream for the generated bundle
- Throws:
org.ops4j.lang.NullArgumentException- if any of the parameters is nullIOException- re-thron during jar processing
-
parseInstructions
public static Properties parseInstructions(String query) throws MalformedURLException
Parses bnd instructions out of an url query string.- Parameters:
query- query part of an url.- Returns:
- parsed instructions as properties
- Throws:
MalformedURLException- if provided path does not comply to syntax.
-
-