public class PropertiesFileLoader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
COMMENT_PREFIX |
static String |
DISABLE_SUFFIX_KEY |
protected File |
propertiesFile |
static Pattern |
PROPERTY_PATTERN
Pattern that matches :
#key=value
key=value
value must be any character except "=" and key must be any character except "#".group(1) returns the key of the property.group(2) returns the value of the property. |
| Constructor and Description |
|---|
PropertiesFileLoader(String path,
String relativeTo) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLineContent(BufferedReader bufferedFileReader,
List<String> content,
String line)
Add the line to the content
|
protected void |
beginPersistence()
Method called to indicate the start of persisting the properties.
|
protected void |
endPersistence(BufferedWriter writer)
Method called to indicate persisting the properties file is now complete.
|
static String |
escapeString(String name,
char[] escapeArray) |
org.jboss.msc.inject.Injector<PathManager> |
getPathManagerInjectorInjector() |
Properties |
getProperties() |
protected void |
load() |
protected void |
loadAsRequired() |
void |
persistProperties()
Saves changes in properties file.
|
protected List<String> |
readFile(File file) |
protected void |
safeClose(Closeable c) |
void |
start(org.jboss.msc.service.StartContext context) |
void |
stop(org.jboss.msc.service.StopContext context) |
protected void |
verifyProperties(Properties properties)
Provides the base class with an opportunity to verify the contents of the properties before they are used.
|
protected void |
write(BufferedWriter writer,
String line,
boolean newLine) |
protected static final String COMMENT_PREFIX
public static final Pattern PROPERTY_PATTERN
#key=valuekey=valuevalue must be any character except "=" and key must be any character except "#".group(1) returns the key of the property.group(2) returns the value of the property.public static final String DISABLE_SUFFIX_KEY
protected File propertiesFile
public org.jboss.msc.inject.Injector<PathManager> getPathManagerInjectorInjector()
public void start(org.jboss.msc.service.StartContext context)
throws org.jboss.msc.service.StartException
org.jboss.msc.service.StartExceptionpublic void stop(org.jboss.msc.service.StopContext context)
public Properties getProperties() throws IOException
IOExceptionprotected void loadAsRequired()
throws IOException
IOExceptionprotected void load()
throws IOException
IOExceptionpublic void persistProperties()
throws IOException
IOExceptionprotected List<String> readFile(File file) throws IOException
IOExceptionprotected void addLineContent(BufferedReader bufferedFileReader, List<String> content, String line) throws IOException
bufferedFileReader - The file readercontent - The content of the fileline - The current read lineIOExceptionprotected void beginPersistence()
throws IOException
IOExceptionprotected void write(BufferedWriter writer, String line, boolean newLine) throws IOException
IOExceptionprotected void endPersistence(BufferedWriter writer) throws IOException
IOExceptionprotected void safeClose(Closeable c)
protected void verifyProperties(Properties properties) throws IOException
properties - - The Properties instance to verify.IOExceptionCopyright © 2015 JBoss by Red Hat. All rights reserved.