public class PropertiesFile
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
load(java.util.Properties properties,
java.lang.String path)
Load a properties file from the given path, either from the filesystem or from the classpath.
|
static java.util.Properties |
load(java.net.URL url)
Load a properties file from the given path from the filesystem.
|
static void |
loadFile(java.util.Properties properties,
java.io.File file)
Load a properties file from the given path from the filesystem.
|
static void |
loadResource(java.util.Properties properties,
java.lang.String path)
Load a properties file from the given path from the classpath.
|
public static java.util.Properties load(java.net.URL url)
throws java.io.IOException
url - The URL to load. This must not be null.java.io.FileNotFoundException - if the file could not be found on the filesystem.java.io.IOException - if there was an error reading the file.java.lang.IllegalArgumentException - if file is null.public static void load(java.util.Properties properties,
java.lang.String path)
throws java.io.FileNotFoundException,
java.io.IOException
properties - The properties object to be populated from the contents of the file. This must not be null.path - The path to the file. This must not be null.java.io.FileNotFoundException - if the file could not be found on the filesystem or in the classpath.java.io.IOException - if there was an error reading the file.public static void loadFile(java.util.Properties properties,
java.io.File file)
throws java.io.FileNotFoundException,
java.io.IOException
properties - The properties object to be populated from the contents of the file. This must not be null.file - The file to load. This must not be null.java.io.FileNotFoundException - if the file could not be found on the filesystem.java.io.IOException - if there was an error reading the file.public static void loadResource(java.util.Properties properties,
java.lang.String path)
throws java.io.FileNotFoundException,
java.io.IOException
properties - The properties object to be populated from the contents of the file. This must not be null.path - The path to the file. This must not be null.java.io.FileNotFoundException - if the file could not be found on the classpath.java.io.IOException - if there was an error reading the file.