Class Util
java.lang.Object
org.eclipse.jetty.osgi.boot.utils.Util
Various useful functions utility methods for OSGi wide use.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic org.osgi.framework.FiltercreateFilter(org.osgi.framework.BundleContext bundleContext, String classname, String managedServerName) Create an osgi filter for the given classname and server name.fileNamesAsURLs(String val, String delims) Treating the string as a separated list of filenames, convert and return the list of urls.static StringgetManifestHeaderValue(String name, String altName, Dictionary<String, String> manifest) Get the value of a manifest header.static StringgetManifestHeaderValue(String name, Dictionary<String, String> manifest) Get the value of a manifest header.static StringresolvePropertyValue(String value) recursively substitute the${sysprop}by their actual system property.static voidsetProperty(Dictionary<String, Object> properties, String key, Object value) 
- 
Constructor Details- 
Utilpublic Util()
 
- 
- 
Method Details- 
createFilterpublic static org.osgi.framework.Filter createFilter(org.osgi.framework.BundleContext bundleContext, String classname, String managedServerName) throws org.osgi.framework.InvalidSyntaxException Create an osgi filter for the given classname and server name.- Parameters:
- bundleContext- the- BundleContextinstance to use
- classname- the class to match on the filter
- managedServerName- the name of the jetty server instance
- Returns:
- a new filter
- Throws:
- org.osgi.framework.InvalidSyntaxException- If the filter contains an invalid string that cannot be parsed.
 
- 
getManifestHeaderValuepublic static String getManifestHeaderValue(String name, String altName, Dictionary<String, String> manifest) Get the value of a manifest header.- Parameters:
- name- the name of the header
- altName- an alternative name for the header (useful for deprecated names)
- manifest- the dictionary
- Returns:
- the value from the manifest
 
- 
getManifestHeaderValueGet the value of a manifest header.- Parameters:
- name- the name of the header
- manifest- the dictionary
- Returns:
- the value from the manifest
 
- 
fileNamesAsURLsTreating the string as a separated list of filenames, convert and return the list of urls.- Parameters:
- val- the separated list of filenames
- delims- the separators (default is- ,;)
- Returns:
- the list of URLs found in the input list
- Throws:
- Exception- if unable to convert entry to a URL
 
- 
setProperty
- 
resolvePropertyValuerecursively substitute the${sysprop}by their actual system property.${sysprop,defaultvalue}will use'defaultvalue'as the value if no sysprop is defined. Not the most efficient code but we are shooting for simplicity and speed of development here.- Parameters:
- value- the input string
- Returns:
- the string with replaced properties
 
 
-