public class TXTWriter extends Object
Constructor and Description |
---|
TXTWriter() |
Modifier and Type | Method and Description |
---|---|
void |
addLine(String line,
BufferedWriter out)
Add a line on a text file already existing.
|
void |
addLines(Collection<String> lines,
BufferedWriter out)
Add a list of lines on a text file already existing.
|
void |
addMapListString(Map<String,List<String>> string2list,
BufferedWriter out)
Add a Map of List of Strings on a text file already existing.
|
void |
appendString(String content,
String filePath,
boolean addNewLine)
Append a String in a text file, maintaining the content of the file (if any)
|
void |
appendStrings(Collection<String> content,
String filePath,
boolean addNewLine)
Append a Collection of String in a text file, maintaining the content of the file (if any)
|
void |
writeLines(Collection<String> lines,
String filePath)
Write a set of lines
Add a timestamp at the beginning #yyyy/MM/dd HH:mm:ss
|
void |
writeMapListString(Map<String,List<String>> string2list,
String filePath)
Write a Map of List of Strings on a text file.
|
void |
writeMapString(Map<String,String> string2string,
String filePath)
Write a Map of String on a text file.
|
void |
writeString(String content,
String filePath)
Write a String in a text file
|
void |
writeStringBuffer(StringBuffer stringBuffer,
String filePath)
Write a StringBuffer in a text file
|
public void appendString(String content, String filePath, boolean addNewLine) throws IOException
content
- the string to be writtenfilePath
- the fullpath of the file, together with file name and extensionaddNewLine
- if true, the method appends a String and add a \n to the text fileIOException
- IOExceptionpublic void appendStrings(Collection<String> content, String filePath, boolean addNewLine) throws IOException
content
- the Collection to be writtenfilePath
- the fullpath of the file, together with file name and extensionaddNewLine
- if true, the method appends a String and add a \n to the text fileIOException
- IOExceptionpublic void writeString(String content, String filePath) throws IOException
content
- the string to be writtenfilePath
- the fullpath of the file, together with file name and extensionIOException
- IOExceptionpublic void writeStringBuffer(StringBuffer stringBuffer, String filePath) throws IOException
stringBuffer
- the string bufferfilePath
- the full file nameIOException
- IOExceptionpublic void addLine(String line, BufferedWriter out) throws IOException
line
- the line to addout
- the bufferIOException
- IOExceptionpublic void writeMapString(Map<String,String> string2string, String filePath) throws IOException
string2string
- a map of stringfilePath
- the fullpath of the file, together with file name and extensionIOException
- IOExceptionpublic void writeMapListString(Map<String,List<String>> string2list, String filePath) throws IOException
string2list
- a map of List of StringsfilePath
- the fullpath of the file, together with file name and extensionIOException
- IOExceptionpublic void addMapListString(Map<String,List<String>> string2list, BufferedWriter out) throws IOException
string2list
- a map of List of Stringsout
- the bufferIOException
- IOExceptionpublic void writeLines(Collection<String> lines, String filePath) throws IOException
lines
- a set of stringfilePath
- the fullpath of the file, together with file name and extensionIOException
- IOExceptionpublic void addLines(Collection<String> lines, BufferedWriter out) throws IOException
lines
- the list of lines to addout
- the bufferIOException
- IOExceptionCopyright © 2016. All rights reserved.