Read and write text files.
Text File Manager performs operations with text files simply and easily.
- Add one of the options below to the pom.xml file:
<dependency>
<groupId>io.github.wniemiec-io-java</groupId>
<artifactId>text-file-manager</artifactId>
<version>LATEST</version>
</dependency>
- Run
$ mvn install
- Use it
[...]
import wniemiec.io.java.TextFileManager;
[...]
List<String> content = List.of("hello", "world!");
Path targetFile = Path.of("example-file.txt");
TextFileManager txtFileManager = new TextFileManager(targetFile, StandardCharsets.ISO_8859_1);
txtFileManager.writeLines(content);
System.out.println( txtFileManager.readLines() );
[...]
Property | Parameter type | Return type | Description | Default parameter value |
---|---|---|---|---|
readLines | void |
List<String> |
Gets all lines from a file and puts them in a list | - |
writeLines | lines: List<String> |
void |
Writes all items in a string list to a file | - |
getFileLineThatContains | sequence: CharSequence |
String |
Searches for a line that contains a sequence | - |
Details about each version are documented in the releases section.
See the documentation on how you can contribute to the project here.
Name | Type | Description |
---|---|---|
dist | Directory |
Released versions |
docs | Directory |
Documentation files |
src | Directory |
Source files |