Skip to content
/ Poet Public

A file management and serialization tool

License

Notifications You must be signed in to change notification settings

limbo56/Poet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poet

Build Status

Poet is a file management and serialization tool written in Java. Poet aims to ease the process of serializing files and managing directories and their content.

Installation

To install Poet through Maven, you will need to add the JitPack repository to your pom.xml file:

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Next, you need to add Poet as a dependency:

<dependency>
    <groupId>com.github.limbo56</groupId>
    <artifactId>Poet</artifactId>
    <version>master-SNAPSHOT</version>
</dependency>

Java 8 is the minimum version required to use this tool

That's it for the installation 🎉

Usage

This project is a library aimed at easing the process of file handling in Java. In the next section, I'm going to be showcasing some of the features of this library.

Deserialization

The Deserializer class is useful when you want a file to be serialized into a certain object type.

To add a deserializer, you must call the Deserializer#addDeserializer. For example, lets say we want to add a deserializer that transforms files into a JsonObject. To achieve this, we need to add a deserializer as follows:

Deserializer.addDeserializer(
    JsonObject.class, 
    file -> JsonParser.parseReader(new FileReader(file)).getAsJsonObject()
);

After that, to deserialize the file, we would call the Deserializer#deserializeFile method:

JsonObject object = Deserializer.deserializeFile(file, JsonObject.class);

Directories

The Directory class is aimed to ease the handling of directories. It contains a variety of methods useful for handling the files in a directory.

Bundles

You can bundle multiple directories using the DirectoryBundle class. This class helps when you want to access common files in multiple directories. For example, this would be useful for localization.

License

This project is licensed under the MIT license. Make sure you read the license before using this library.

About

A file management and serialization tool

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages