public final class ResourceUtils extends Object
Constructor and Description |
---|
ResourceUtils() |
Modifier and Type | Method and Description |
---|---|
static Properties |
getProperties(File file)
Read
Properties from the given file. |
static Properties |
getProperties(URL file)
Read
Properties 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.
|
public static URL getResource(String location)
location
- The resource locationURL
for reading the resource or nullClassUtils.getDefaultClassLoader()
,
ClassLoader.getResource(String)
public static InputStream getResourceStream(String location)
location
- The resource locationgetResource(String)
,
ClassLoader.getResourceAsStream(String)
public static Properties getProperties(URL file) throws IOException
Properties
from the given file.file
- the properties file urlProperties
IOException
- if unable to read filepublic static Properties getProperties(File file) throws IOException
Properties
from the given file.file
- the properties file urlProperties
IOException
- if unable to read file