Package com.axelor.common
Class ResourceUtils
java.lang.Object
com.axelor.common.ResourceUtils
The class provides static helper methods to work with resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiesgetProperties(File file) ReadPropertiesfrom the given file.static PropertiesgetProperties(URL file) ReadPropertiesfrom the given file.static URLgetResource(String location) Finds the resource from the class path with the given location using default ClassLoader.static InputStreamgetResourceStream(String location) Returns an input stream for reading the specified resource.
-
Constructor Details
-
ResourceUtils
public ResourceUtils()
-
-
Method Details
-
getResource
Finds the resource from the class path with the given location using default ClassLoader.- Parameters:
location- The resource location- Returns:
- an
URLfor reading the resource or null - See Also:
-
getResourceStream
Returns an input stream for reading the specified resource.- Parameters:
location- The resource location- Returns:
- An input stream for reading the resource or null
- See Also:
-
getProperties
ReadPropertiesfrom the given file.- Parameters:
file- the properties file url- Returns:
Properties- Throws:
IOException- if unable to read file
-
getProperties
ReadPropertiesfrom the given file.- Parameters:
file- the properties file url- Returns:
Properties- Throws:
IOException- if unable to read file
-