file-grabber

Easy to read and write text files

License

License

GroupId

GroupId

org.riversun
ArtifactId

ArtifactId

file-grabber
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

file-grabber
Easy to read and write text files
Project URL

Project URL

https://github.com/riversun/file-grabber
Source Code Management

Source Code Management

https://github.com/riversun/file-grabber

Download file-grabber

How to add to project

<!-- https://jarcasting.com/artifacts/org.riversun/file-grabber/ -->
<dependency>
    <groupId>org.riversun</groupId>
    <artifactId>file-grabber</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.riversun/file-grabber/
implementation 'org.riversun:file-grabber:1.1.0'
// https://jarcasting.com/artifacts/org.riversun/file-grabber/
implementation ("org.riversun:file-grabber:1.1.0")
'org.riversun:file-grabber:jar:1.1.0'
<dependency org="org.riversun" name="file-grabber" rev="1.1.0">
  <artifact name="file-grabber" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.riversun', module='file-grabber', version='1.1.0')
)
libraryDependencies += "org.riversun" % "file-grabber" % "1.1.0"
[org.riversun/file-grabber "1.1.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.7

Project Modules

There are no modules declared in this project.

file-grabber

Java lib for easy to handle and manipulate the text file

Write Text to Text File

Save file as UTF-8

		TextFileWriter w = new TextFileWriter();
		w.writeText(file, string, "UTF-8", false);

Save file as UTF8 with BOM

		TextFileWriter w = new TextFileWriter();
		w.writeTextAsUTF8WithBOM(file, string, false);

Read Text from Text File

Read full text as String

  • org.riversun.file_grabber.TextFileReader.readText(File)
  • org.riversun.file_grabber.TextFileReader.readText(File, String)
  • org.riversun.file_grabber.TextFileReader.readText(InputStream, String)

Read text from resource (source code resources folder)

  • org.riversun.file_grabber.TextFileReader.readTextFromResource(Class<?>, String, String)
import java.io.IOException;
import org.riversun.file_grabber.TextFileReader;

public class TextReaderExample {

	public static void main(String[] args) throws IOException {
		TextReaderExample o = new TextReaderExample();
		o.doTest();
	}

	public void doTest() throws IOException {
		TextFileReader tr = new TextFileReader();
		String text = tr.readTextFromResource(this.getClass(), "test.txt", "UTF-8");
		System.out.println(text);

	}
}

Read fulltext char by char

  • org.riversun.file_grabber.TextFileReader.readTextCharByChar(File)
  • org.riversun.file_grabber.TextFileReader.readTextCharByChar(File, String)
  • org.riversun.file_grabber.TextFileReader.readTextCharByChar(InputStream, String)

Read fulltext as List

  • org.riversun.file_grabber.TextFileReader.readTextAsList(File)
  • org.riversun.file_grabber.TextFileReader.readTextAsListWithRange(File, int, int)
  • org.riversun.file_grabber.TextFileReader.readTextAsList(File, String)
  • org.riversun.file_grabber.TextFileReader.readTextAsListWithRange(File, String, int, int)
  • org.riversun.file_grabber.TextFileReader.readTextAsList(InputStream, String)
  • org.riversun.file_grabber.TextFileReader.readTextAsListWithRange(InputStream, String, int, int)

Maven

<dependency>
		<groupId>org.riversun</groupId>
		<artifactId>file-grabber</artifactId>
		<version>1.1.0</version>
</dependency>

Versions

Version
1.1.0
1.0.0
0.3.1
0.3.0
0.2.0
0.1.0