Skip to content

javadelight/delight-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

delight-files

This library provides an abstract, cross-platform API for working with files and folders.

Why This is a very lightweight abstraction on top of vanilla java.io.File. Adding this project as a dependency to your projects should come with very little risk. Using the FileItem class is infinitely more convenient than using the standard Java classes for many use cases.

Usage

Creating a New File And Setting Its Contents

FileItem file = FilesJre.wrap(new File("/tmp"))
    
file.assertFolder("a Folder").createFile("my file.txt").setText("The content")

Reading File Contents as String

FileItem file = FilesJre.wrap(new File("/tmp/my file.txt"));

String content = file.getText();

System.out.println(content);

Traversing through Directories

FileItem file = FilesJre.wrap(new File("/"));

boolean there = file.get("tmp").get("my file.txt").exists();

More Operations

For more operations check the JavaDoc of FileItem.

Compatibility

This project is compatible with the following environments:

  • Java 1.6+
  • GWT 2.5.0+
  • Android (any)
  • OSGi (any)

Further Resources

About

A productive API for working with files in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published