java.io.FileWriter but uses the AtomicFileOutputStream as the
underlying output stream. In this way, we make sure that the errors during the write process do not destroy the
contents of the target file.
Moreover, this writer checks if the chosen encoding supports all text that is written. Characters whose encoding
was problematic can be retrieved by getEncodingProblems().
| Modifier and Type | Field and Description |
|---|---|
| private final CharsetEncoder | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Set | |
| public boolean | |
| public void |
| encoder | back to summary |
|---|---|
| private final CharsetEncoder encoder | |
| problemCharacters | back to summary |
|---|---|
| private final Set<Character> problemCharacters | |
| AtomicFileWriter | back to summary |
|---|---|
| public AtomicFileWriter(Path file, Charset encoding) throws IOException | |
| AtomicFileWriter | back to summary |
|---|---|
| public AtomicFileWriter(Path file, Charset encoding, boolean keepBackup) throws IOException | |
| getEncodingProblems | back to summary |
|---|---|
| public Set | |
| hasEncodingProblems | back to summary |
|---|---|
| public boolean hasEncodingProblems() | |
| write | back to summary |
|---|---|
| public void write(String str) throws IOException Overrides java. Doc from java. Writes a string.
| |