Skip to content

LenarBad/files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Maven Central

Build Status Hits of Code Lines of Code

Easy Files

Maven dependency

    <dependency>
        <groupId>io.lenar</groupId>
        <artifactId>files</artifactId>
        <version>1.6.1</version>
    </dependency>

Resources folder files - ResourceFile

Reading files in the resources folder

No matter if the resource files are in the File System or in the Jar.

ResourceFile file = new ResourceFile("my-file.json");

Regular files in File System - UserFiles, UserHomeFile

UserFile file = new UserFile("c:/myfiles/myfile.txt");
UserHomeFile file = new UserHomeFile("my-user-home-test.txt");

Network sources

It can be a file somewhere in the Internet or other resources accessible through urls.

NetworkSource file = new NetworkSource("https://github.com/LenarBad/files")

Read file examples

String content = file.content();
List<String> lines = file.lines();

Book book = file.fromJson(Book.class);
List<Book> books = file.fromJsonAsList(Book[].class);

Book book = file.fromYaml(Book.class);
List<Book> books = file.fromYamlAsList(Book.class);

Properties properties = file.properties();

About

Read files with easy... with Easy Files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages