public class PropertiesFileUtil extends Object
Constructor and Description |
---|
PropertiesFileUtil() |
Modifier and Type | Method and Description |
---|---|
static Properties |
read(File propertiesFile)
Loads a
.properties -formatted file from disk into a Properties object. |
static Properties |
read(String propertiesPath)
Loads a
.properties -formatted file from disk into a Properties object. |
static void |
write(File propertiesFile,
Properties data,
String comment)
Writes a
Properties object to disk. |
static void |
write(String propertiesPath,
Properties data,
String comment)
Writes a
Properties object to disk. |
public static Properties read(String propertiesPath)
.properties
-formatted file from disk into a Properties
object. On error,
the input stream is properly closed and a user-friendly exception is thrown.propertiesPath
- the path to the file to loadProperties
object populated with the specified file's datapublic static Properties read(File propertiesFile)
.properties
-formatted file from disk into a Properties
object. On error,
the input stream is properly closed and a user-friendly exception is thrown.propertiesFile
- the file to loadProperties
object populated with the specified file's datapublic static void write(String propertiesPath, Properties data, String comment)
Properties
object to disk. On error, the output stream is properly closed and a
user-friendly exception is thrown.propertiesPath
- the path to the file to writedata
- the Properties
object to storecomment
- an optional comment to include at the top of the written filepublic static void write(File propertiesFile, Properties data, String comment)
Properties
object to disk. On error, the output stream is properly closed and a
user-friendly exception is thrown.propertiesFile
- the file to writedata
- the Properties
object to storecomment
- an optional comment to include at the top of the written fileCopyright © 2021 Actian Corporation. All rights reserved.