|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.File
com.antelmann.io.IniFile
public class IniFile
a file that loads properties to standard *.ini conventions
(unlike the class java.util.Properties)
| Field Summary | |
|---|---|
protected String |
charset
uses the default charset of this Java virtual machine by default |
protected char[] |
commentIndicator
uses '#' and '[' by default, the array must never be empty |
protected String |
fieldSeparator
uses the equal sign '=' by default |
| Fields inherited from class java.io.File |
|---|
pathSeparator, pathSeparatorChar, separator, separatorChar |
| Constructor Summary | |
|---|---|
IniFile(File file)
|
|
IniFile(File file,
String charset)
|
|
| Method Summary | |
|---|---|
protected boolean |
isCommentLine(String line)
checks whether the line is considered a comment. |
protected String[] |
parseLine(String line)
returns either null or an array of size 2, containing key/value pair. |
Properties |
readProperties()
|
IniFile |
setCommentIndicator(char... commentIndicator)
returns this |
IniFile |
setFieldSeparator(String fieldSeparator)
returns this |
void |
store(Properties props,
String comment)
|
| Methods inherited from class java.io.File |
|---|
canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getName, getParent, getParentFile, getPath, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setLastModified, setReadOnly, toString, toURI, toURL |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String fieldSeparator
protected char[] commentIndicator
protected String charset
| Constructor Detail |
|---|
public IniFile(File file)
public IniFile(File file,
String charset)
| Method Detail |
|---|
public IniFile setFieldSeparator(String fieldSeparator)
public IniFile setCommentIndicator(char... commentIndicator)
public Properties readProperties()
throws IOException
IOExceptionprotected String[] parseLine(String line)
isCommentLine(String)protected boolean isCommentLine(String line)
commentIndicator.
public void store(Properties props,
String comment)
throws IOException
IOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||