public DefaultInMemoryTokenStore(Bus b) { super("STS", b, ClassLoaderUtils.getResource("cxf-ehcache.xml", DefaultInMemoryTokenStore.class)); } public DefaultInMemoryTokenStore() {
public DefaultInMemoryTokenStore(Bus b) { super("STS", b, ClassLoaderUtils.getResource("cxf-ehcache.xml", DefaultInMemoryTokenStore.class)); } public DefaultInMemoryTokenStore() {
/** * This is a convenience method to load a resource as a stream. <p/> The * algorithm used to find the resource is given in getResource() * * @param resourceName The name of the resource to load * @param callingClass The Class object of the calling object */ public static InputStream getResourceAsStream(String resourceName, Class<?> callingClass) { URL url = getResource(resourceName, callingClass); try { return (url != null) ? url.openStream() : null; } catch (IOException e) { return null; } }
/** * This is a convenience method to load a resource as a stream. <p/> The * algorithm used to find the resource is given in getResource() * * @param resourceName The name of the resource to load * @param callingClass The Class object of the calling object */ public static InputStream getResourceAsStream(String resourceName, Class callingClass) { URL url = getResource(resourceName, callingClass); try { return (url != null) ? url.openStream() : null; } catch (IOException e) { return null; } }
/** * This is a convenience method to load a resource as a stream. <p/> The * algorithm used to find the resource is given in getResource() * * @param resourceName The name of the resource to load * @param callingClass The Class object of the calling object */ public static InputStream getResourceAsStream(String resourceName, Class<?> callingClass) { URL url = getResource(resourceName, callingClass); try { return (url != null) ? url.openStream() : null; } catch (IOException e) { return null; } }
/** * This is a convenience method to load a resource as a stream. <p/> The * algorithm used to find the resource is given in getResource() * * @param resourceName The name of the resource to load * @param callingClass The Class object of the calling object */ public static InputStream getResourceAsStream(String resourceName, Class<?> callingClass) { URL url = getResource(resourceName, callingClass); try { return (url != null) ? url.openStream() : null; } catch (IOException e) { return null; } }
/** * This is a convenience method to load a resource as a stream. <p/> The * algorithm used to find the resource is given in getResource() * * @param resourceName The name of the resource to load * @param callingClass The Class object of the calling object */ public static InputStream getResourceAsStream(String resourceName, Class<?> callingClass) { URL url = getResource(resourceName, callingClass); try { return (url != null) ? url.openStream() : null; } catch (IOException e) { return null; } }
public static URL getClasspathResourceURL(String path, Class<?> callingClass, Bus bus) { URL url = ClassLoaderUtils.getResource(path, callingClass); return url == null ? getResource(path, URL.class, bus) : url; }
protected List<InputSource> getDefaultSchemas() throws IOException { List<InputSource> xsdList = new ArrayList<>(); URL url = ClassLoaderUtils.getResource("/schemas/configuration/parameterized-types.xsd", this.getClass()); if (url != null) { InputSource is = new InputSource(url.openStream()); is.setSystemId(url.toString()); xsdList.add(is); } addDefaultSchemas(ToolConstants.CXF_SCHEMAS_DIR_INJAR, xsdList); return xsdList; } private void addDefaultSchemas(String location, List<InputSource> xsdList) throws IOException {
public DefaultInMemoryTokenStore() { super("STS", BusFactory.getDefaultBus(), ClassLoaderUtils.getResource("cxf-ehcache.xml", DefaultInMemoryTokenStore.class)); }
public static URL getClasspathResourceURL(String path, Class<?> callingClass, Bus bus) { URL url = ClassLoaderUtils.getResource(path, callingClass); return url == null ? getResource(path, URL.class, bus) : url; }
protected List<InputSource> getDefaultSchemas() throws IOException { List<InputSource> xsdList = new ArrayList<>(); URL url = ClassLoaderUtils.getResource("/schemas/configuration/parameterized-types.xsd", this.getClass()); if (url != null) { InputSource is = new InputSource(url.openStream()); is.setSystemId(url.toString()); xsdList.add(is); } addDefaultSchemas(ToolConstants.CXF_SCHEMAS_DIR_INJAR, xsdList); return xsdList; } private void addDefaultSchemas(String location, List<InputSource> xsdList) throws IOException {
public static URL getClasspathResourceURL(String path, Class<?> callingClass, Bus bus) { URL url = ClassLoaderUtils.getResource(path, callingClass); return url == null ? getResource(path, URL.class, bus) : url; }
public DefaultInMemoryTokenStore() { super("STS", BusFactory.getDefaultBus(), ClassLoaderUtils.getResource("cxf-ehcache.xml", DefaultInMemoryTokenStore.class)); }
public static URL getClasspathResourceURL(String path, Class<?> callingClass, Bus bus) { URL url = ClassLoaderUtils.getResource(path, callingClass); return url == null ? getResource(path, URL.class, bus) : url; }
public final void setScript(String scriptLocation) throws IOException { URL resource = ClassLoaderUtils.getResource(scriptLocation, this.getClass()); if (resource != null) { scriptLocation = resource.getPath(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Script found within Classpath: " + scriptLocation); } } File scriptFile = new File(scriptLocation); if (scriptFile.exists()) { this.script = jexlEngine.createScript(scriptFile); } else { throw new IllegalArgumentException("Script resource not found!"); } }
public final void setScript(String scriptLocation) throws IOException { URL resource = ClassLoaderUtils.getResource(scriptLocation, this.getClass()); if (resource != null) { scriptLocation = resource.getPath(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Script found within Classpath: " + scriptLocation); } } File scriptFile = new File(scriptLocation); if (scriptFile.exists()) { this.script = jexlEngine.createScript(scriptFile); } else { throw new IllegalArgumentException("Script resource not found!"); } }
private TokenStore configureTokenStore() throws MalformedURLException { if (TokenStoreFactory.isEhCacheInstalled()) { String cfg = "cxf-ehcache.xml"; URL url = null; if (url == null) { url = ClassLoaderUtils.getResource(cfg, STSLoginModule.class); } if (url == null) { url = new URL(cfg); } if (url != null) { return new EHCacheTokenStore(TOKEN_STORE_KEY, BusFactory.getDefaultBus(), url); } } return null; }
private TokenStore configureTokenStore() throws MalformedURLException { if (TokenStoreFactory.isEhCacheInstalled()) { String cfg = "cxf-ehcache.xml"; URL url = null; if (url == null) { url = ClassLoaderUtils.getResource(cfg, STSLoginModule.class); } if (url == null) { url = new URL(cfg); } if (url != null) { return new EHCacheTokenStore(TOKEN_STORE_KEY, BusFactory.getDefaultBus(), url); } } return null; }
private URL getDefaultConfigFileURL() { URL url = null; if (super.getBus() != null) { ResourceManager rm = super.getBus().getExtension(ResourceManager.class); url = rm.resolveResource("sts-ehcache.xml", URL.class); } try { if (url == null) { url = ClassLoaderUtils.getResource("sts-ehcache.xml", TokenStoreFactory.class); } if (url == null) { url = new URL("sts-ehcache.xml"); } return url; } catch (IOException e) { // Do nothing } return null; }