java.lang.Object
com.aoapps.lang.util.PropertiesUtils
Property utilities.
See com.aoapps.servlet.PropertiesUtils for use in servlet environment
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Properties
loadFromFile
(File file) Loads properties from a file.static Properties
loadFromResource
(Class<?> clazz, String resource) Loads properties from a module or classpath resource.
-
Field Details
-
RESOURCES
-
-
Method Details
-
loadFromFile
Loads properties from a file.- Throws:
IOException
-
loadFromResource
Loads properties from a module or classpath resource.- Attempts to locate the resource with
Class.getResourceAsStream(java.lang.String)
- If resource name begins with a slash (/):
- Strip all beginning slashes (/) from resource name
-
If
Thread.getContextClassLoader()
is non-null, attempts to locate the resource withClassLoader.getResourceAsStream(java.lang.String)
. -
Otherwise, attempts to locate the resource with
ClassLoader.getSystemResourceAsStream(java.lang.String)
.
- Throws:
IOException
- Attempts to locate the resource with
-