Package com.vaadin.flow.di
Interface ResourceProvider
-
- All Known Implementing Classes:
LookupInitializer.ResourceProviderImpl
public interface ResourceProvider
Static "classpath" resources provider.This is SPI to access resources available at runtime. Depending on the web container this can be an application classpath only or bundles which are identified by the provided context.
- Since:
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description URL
getApplicationResource(String path)
Gets the resource identified bypath
located in the application bundle (jar) which may be found using this resource provider instance.List<URL>
getApplicationResources(String path)
Gets all the resources identified bypath
located in in the application bundle (jar) which may be found using this resource provider.URL
getClientResource(String path)
Gets "flow-client" bundle resource identified by thepath
.InputStream
getClientResourceAsStream(String path)
Gets "flow-client" bundle resource content identified by thepath
.
-
-
-
Method Detail
-
getApplicationResource
URL getApplicationResource(String path)
Gets the resource identified bypath
located in the application bundle (jar) which may be found using this resource provider instance.If the provider doesn't contain any information about application bundle or there is no resource with the given path then this method returns
null
.- Parameters:
path
- the resource path- Returns:
- an URL of the resource, may be
null
-
getApplicationResources
List<URL> getApplicationResources(String path) throws IOException
Gets all the resources identified bypath
located in in the application bundle (jar) which may be found using this resource provider.If the provider doesn't contain any information about application bundle or there is no resource with the given path then this method returns an empty list.
- Parameters:
path
- the resource path- Returns:
- a list of URLs of the resources or an empty list if resources are not found
- Throws:
IOException
- if there is an I/O error
-
getClientResource
URL getClientResource(String path)
Gets "flow-client" bundle resource identified by thepath
.- Parameters:
path
- the resource path- Returns:
- an URL of the resource, may be
null
-
getClientResourceAsStream
InputStream getClientResourceAsStream(String path) throws IOException
Gets "flow-client" bundle resource content identified by thepath
.- Parameters:
path
- the resource path- Returns:
- an URL of the resource, may be
null
- Throws:
IOException
- If there is an I/O error.
-
-