Skip to content

mjfryc/mjaron-datanode-java

Repository files navigation

mjaron-datanode-java

Java CI with Gradle Gradle Package Maven Central

[DRAFT] Abstract file tree with several implementations.

API description

This library defines universal INode interface and provides some implementations for this interface:

  • FileNode - standard filesystem node based on java.io.File.
import pl.mjaron.datanode;

public class Sample {
    public static void main(String[] args) {
        final String sentence = "Hello world\nByeWorld.";
        final INode root = new FileNode("root_dir");
        root
                .getChild("subdirectory").mkdirs()
                .getChild("file.txt").remove().touch()
                .write(sentence);

        final String checkedContent = new FileNode("root_dir/subdirectory/file.txt").readString();
        Assertions.assertEquals(sentence, checkedContent);
    }
}

Integration

Maven Central

dependencies {

implementation 'io.github.mjfryc:mjaron-datanode-java:1.0.0'

}

GitHub Packages

Click the Packages section on the right.

Download directly

  1. Click the Packages section on the right.
  2. Find and download jar package from files list to e.g. your_project_root/libs dir.
  3. Add this jar to project dependencies in build.gradle, e.g:
implementation files(project.rootDir.absolutePath + '/libs/mjaron-datanode-java-1.0.0.jar')