public class Util
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DELIMS |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static org.osgi.framework.Filter |
createFilter(org.osgi.framework.BundleContext bundleContext,
java.lang.String classname,
java.lang.String managedServerName)
Create an osgi filter for the given classname and server name.
|
static java.util.List<java.net.URL> |
fileNamesAsURLs(java.lang.String val,
java.lang.String delims)
Treating the string as a separated list of filenames,
convert and return the list of urls.
|
static java.lang.String |
getManifestHeaderValue(java.lang.String name,
java.lang.String altName,
java.util.Dictionary<java.lang.String,java.lang.String> manifest)
Get the value of a manifest header.
|
static java.lang.String |
resolvePropertyValue(java.lang.String value)
recursively substitute the
${sysprop} by their actual system property. |
static void |
setProperty(java.util.Dictionary<java.lang.String,java.lang.Object> properties,
java.lang.String key,
java.lang.Object value) |
public static final java.lang.String DEFAULT_DELIMS
public static org.osgi.framework.Filter createFilter(org.osgi.framework.BundleContext bundleContext, java.lang.String classname, java.lang.String managedServerName) throws org.osgi.framework.InvalidSyntaxException
bundleContext
- the BundleContext
instance to useclassname
- the class to match on the filtermanagedServerName
- the name of the jetty server instanceorg.osgi.framework.InvalidSyntaxException
- If the filter contains an invalid string that cannot be parsed.public static java.lang.String getManifestHeaderValue(java.lang.String name, java.lang.String altName, java.util.Dictionary<java.lang.String,java.lang.String> manifest)
name
- the name of the headeraltName
- an alternative name for the header (useful for deprecated names)manifest
- the dictionarypublic static java.util.List<java.net.URL> fileNamesAsURLs(java.lang.String val, java.lang.String delims) throws java.lang.Exception
val
- the separated list of filenamesdelims
- the separators (default is ,;
)java.lang.Exception
- if unable to convert entry to a URLpublic static void setProperty(java.util.Dictionary<java.lang.String,java.lang.Object> properties, java.lang.String key, java.lang.Object value)
public static java.lang.String resolvePropertyValue(java.lang.String value)
${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.value
- the input stringCopyright © 1995–2023 Webtide. All rights reserved.