Class PolicyUtils.ConfigFile
- java.lang.Object
-
- com.sun.xml.ws.policy.privateutil.PolicyUtils.ConfigFile
-
- Enclosing class:
- PolicyUtils
public static class PolicyUtils.ConfigFile extends Object
-
-
Constructor Summary
Constructors Constructor Description ConfigFile()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
generateFullName(String configFileIdentifier)
Generates a config file resource name from provided config file identifier.static URL
loadFromClasspath(String configFileName)
Returns a URL pointing to the given config file.static URL
loadFromContext(String configFileName, Object context)
Returns a URL pointing to the given config file.
-
-
-
Method Detail
-
generateFullName
public static String generateFullName(String configFileIdentifier) throws PolicyException
Generates a config file resource name from provided config file identifier. The generated file name can be transformed into a URL instance usingloadFromContext(String, Object)
orloadFromClasspath(String)
method.- Parameters:
configFileIdentifier
- the string used to generate the config file URL that will be parsed. Each WSIT config file is in form ofwsit-{configFileIdentifier}.xml
. Must not benull
.- Returns:
- generated config file resource name
- Throws:
PolicyException
- If configFileIdentifier is null.
-
loadFromContext
public static URL loadFromContext(String configFileName, Object context)
Returns a URL pointing to the given config file. The file name is looked up as a resource from a ServletContext. May return null if the file can not be found.- Parameters:
configFileName
- The name of the file resourcecontext
- A ServletContext object. May not be null.
-
loadFromClasspath
public static URL loadFromClasspath(String configFileName)
Returns a URL pointing to the given config file. The file is looked up as a resource on the classpath. May return null if the file can not be found.- Parameters:
configFileName
- the name of the file resource. May not benull
.
-
-