Simple JAVA file distribution library.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
build.xml

README.md

Simple JAVA file distribution library.

Description:

Simple library that allows organize distribution of files within hex based tree.

Download file_distribution.jar:

JAR files can be download from here.

Example of usage:

    FileDistribution fd = new FileDistribution("/tmp/storage");

    // default extensions
    int database_id = 1;
    fd.hexPath(database_id);
    fd.renameFrom("/tmp/upload/file1.txt");

    System.out.println( fd.getPath() ); // saved file path

    // set all extensions to .pdf
    database_id = 256;
    fd.setExtension(".pdf");
    fd.hexPath(database_id);
    fd.renameFrom("/tmp/upload/file2.txt");
    
    System.out.println( fd.getPath() ); // saved file path

Files should be stored in /tmp/storage/01.dat and /tmp/storage/01/00.pdf