Package org.wso2.carbon.ui
Class BundleBasedUIResourceProvider
- java.lang.Object
-
- org.wso2.carbon.ui.BundleBasedUIResourceProvider
-
- All Implemented Interfaces:
UIResourceProvider
public class BundleBasedUIResourceProvider extends Object implements UIResourceProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.logging.Loglog
-
Constructor Summary
Constructors Constructor Description BundleBasedUIResourceProvider(String bundleResourcePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBundleResourcePaths(org.osgi.framework.Bundle bundle)org.osgi.framework.BundlegetBundle(String resourcePath)URLgetUIResource(String name)Returns a URL to the resource that is mapped to a specified path.Set<String>getUIResourcePaths(String name)Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.voidremoveBundleResourcePaths(org.osgi.framework.Bundle bundle)
-
-
-
Constructor Detail
-
BundleBasedUIResourceProvider
public BundleBasedUIResourceProvider(String bundleResourcePath)
-
-
Method Detail
-
getUIResource
public URL getUIResource(String name)
Description copied from interface:UIResourceProviderReturns a URL to the resource that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root. This method returns null if no resource is mapped to the pathname.- Specified by:
getUIResourcein interfaceUIResourceProvider- Parameters:
name- a String specifying the path to the resource- Returns:
- the resource located at the named path, or null if there is no resource at that path
-
getUIResourcePaths
public Set<String> getUIResourcePaths(String name)
Description copied from interface:UIResourceProviderReturns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument. Paths indicating subdirectory paths end with a '/'. The returned paths are all relative to the root of resource provider and have a leading '/'. For example, for a resource provider containing /welcome.html /WEB_INF /WEB-INF/web.xml /WEB-INF/tiles /WEB-INF/tiles/main_defs.xml getResourcePaths("/") returns {"/welcome.html", "/WEB_INF"}. getResourcePaths("/WEB_INF/") returns {"/WEB-INF/web.xml", "/WEB-INF/tiles/"}. getResourcePaths("/WEB-INF/tiles/") returns {"/WEB-INF/tiles/main_defs.xml"}.- Specified by:
getUIResourcePathsin interfaceUIResourceProvider- Parameters:
name- partial path used to match the resources, which must start with a /- Returns:
- a Set containing the directory listing, or null if there are no resources whose path begins with the supplied path.
-
addBundleResourcePaths
public void addBundleResourcePaths(org.osgi.framework.Bundle bundle)
-
removeBundleResourcePaths
public void removeBundleResourcePaths(org.osgi.framework.Bundle bundle)
-
getBundle
public org.osgi.framework.Bundle getBundle(String resourcePath)
-
-