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 Properties
getProperties
(File file) ReadProperties
from the given file.static Properties
getProperties
(URL file) ReadProperties
from the given file.static URL
getResource
(String location) Finds the resource from the class path with the given location using default ClassLoader.static InputStream
getResourceStream
(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
URL
for 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
ReadProperties
from the given file.- Parameters:
file
- the properties file url- Returns:
Properties
- Throws:
IOException
- if unable to read file
-
getProperties
ReadProperties
from the given file.- Parameters:
file
- the properties file url- Returns:
Properties
- Throws:
IOException
- if unable to read file
-