public class PropertiesFileLoader extends java.lang.Object implements ILineProcessor
Modifier and Type | Method and Description |
---|---|
protected FileUtil |
fileUtil() |
protected PropertiesFileContent |
getProperties() |
protected PropertiesFileContent |
loadFrom(FileLocator locator)
Reads all text lines from the given file and returns the in an
PropertiesFileContent object.
|
protected PropertiesFileContent |
loadFrom(java.io.InputStream stream)
Reads all text lines from the given stream and returns the in an
PropertiesFileContent object.
|
protected PropertiesFileContent |
loadFrom(java.io.Reader reader)
Reads all text lines from the given reader and returns the in an
PropertiesFileContent object.
|
static PropertiesFileContent |
loadFullPropertiesFile(java.io.InputStream stream)
Reads all text lines from the given stream and returns the result in an
PropertiesFileContent object.
|
static PropertiesFileContent |
loadFullPropertiesFile(java.io.Reader reader)
Reads all text lines from the given stream and returns the result in an
PropertiesFileContent object.
|
static PropertiesFileContent |
loadFullPropertiesFile(java.lang.String filename)
Reads all text lines from the given file and returns the result in an
PropertiesFileContent object.
|
static java.util.Properties |
loadProperties(java.io.File file)
Loads all properties from the given file.
|
static java.util.Properties |
loadProperties(FileLocator locator)
Loads all properties from the specified file.
|
static java.util.Properties |
loadProperties(FileLocator locator,
java.util.Properties defaults)
Load all properties from the given file.
|
static java.util.Properties |
loadProperties(java.io.File file,
java.util.Properties defaults)
Load all properties from the given file.
|
static java.util.Properties |
loadProperties(java.io.InputStream stream)
Loads all properties from the given stream.
|
static java.util.Properties |
loadProperties(java.io.InputStream stream,
java.util.Properties defaults)
Loads all properties from the given stream.
|
static java.util.Properties |
loadProperties(java.lang.String filename)
Loads all properties from the file with the given name.
|
static java.util.Properties |
loadProperties(java.lang.String filename,
java.util.Properties defaults)
Loads all properties from the file with the given name.
|
static java.util.Properties |
loadProperties(java.net.URL url,
java.util.Properties defaults)
Load all properties from the file specified by the given URL.
|
boolean |
processLine(java.lang.String line,
int lineNo)
Processes each line that is read from the file
|
protected void |
setProperties(PropertiesFileContent newValue) |
public static java.util.Properties loadProperties(java.lang.String filename)
public static java.util.Properties loadProperties(java.lang.String filename, java.util.Properties defaults)
public static java.util.Properties loadProperties(java.io.File file)
public static java.util.Properties loadProperties(java.io.File file, java.util.Properties defaults)
public static java.util.Properties loadProperties(FileLocator locator)
public static java.util.Properties loadProperties(FileLocator locator, java.util.Properties defaults)
public static java.util.Properties loadProperties(java.net.URL url, java.util.Properties defaults)
url
- The url that specifies the file to read the properties fromdefaults
- The default properties to be put into the result (may be null)public static java.util.Properties loadProperties(java.io.InputStream stream, java.util.Properties defaults) throws java.io.IOException
stream
- The stream to read the properties fromdefaults
- The default properties (might be null)java.io.IOException
public static java.util.Properties loadProperties(java.io.InputStream stream) throws java.io.IOException
stream
- The stream to read the properties fromjava.io.IOException
public static PropertiesFileContent loadFullPropertiesFile(java.lang.String filename) throws java.io.IOException
filename
- The name of the file to read (can be also a URL)java.io.IOException
public static PropertiesFileContent loadFullPropertiesFile(java.io.Reader reader) throws java.io.IOException
reader
- The reader to load the data fromjava.io.IOException
public static PropertiesFileContent loadFullPropertiesFile(java.io.InputStream stream) throws java.io.IOException
stream
- The stream to read the data fromjava.io.IOException
public boolean processLine(java.lang.String line, int lineNo)
processLine
in interface ILineProcessor
line
- The line to process (must not be null)lineNo
- The line number (starting with 1)protected PropertiesFileContent loadFrom(FileLocator locator) throws java.io.IOException
locator
- The locator of the file to read (must not be null).java.io.IOException
protected PropertiesFileContent loadFrom(java.io.InputStream stream) throws java.io.IOException
stream
- The stream to read the properties fromjava.io.IOException
protected PropertiesFileContent loadFrom(java.io.Reader reader) throws java.io.IOException
reader
- The reader to read the properties fromjava.io.IOException
protected PropertiesFileContent getProperties()
protected void setProperties(PropertiesFileContent newValue)
protected FileUtil fileUtil()