Giter VIP home page Giter VIP logo

file-organizer's Introduction

file-organizer

Organize files automatically in folders with metadata.

This program organize any types of files with their metadata (lastModifiedTime because creationTime is changed after all copy) and it preserve old metadata.

MainWindow Preview Dialog
MainWindow PreviewDialog

It is possible to select input and output directories through the interface and get a preview of the arrangment. In addition, you can adjust the two variables of the algorithm (maxElementsPerDate and elementsPerDateTolerence).

Screenshots are available in screenshots directory and an example for testing (automatically selected by default) in sample directory.

Run it

file-organizer is a maven project, use your favorite IDE or type the following command in your favorite prompt:

$ mvn compile
$ mvn exec:java

Algorithm notes

Implemented in the FileDateMap class, can be found in fileorganizer/model.

Treatment phases

  • storeFileByDate: files are stored by date (hashmap with date as key)
  • mergeFilesInFolders: most important part which makes groups with multiple dates
  • makeFolderOrganization: compute folders names and makes the output directory hierarchy

Variables

  • maxElementsPerDate
    Maximum of files allowed in a single folder (used during mergeFilesInFolders)

  • elementsPerDateTolerence
    In the case of [5, 3, 35] (numbers of files per date) if the maximum is set to 7 the algorithm will not merge 5 and 3.
    It is possible to go through it by adding a tolerance: with a tolerence of 1, the maximum will be 7 + 1 = 8 so the algorithm will perform the merge between 5 and 3.

    • This not works if the two folders are not in the same year and month.
    • Tolerence is only used when the following date is too big (35 in the example), it avoids to get tiny folders (3 in the example)

Key points

  • The output directory hierarchy begins with the year, then the month and a day (if necessary)

    • There are one folder per year, if no files are dated from a given year the folder will not be created
  • Until there are not enough files to reach the maximum for one folder (and dates have the same year), dates directories will be merged into one directory

    • Month can be merged, the result folder will be named "1-4" if it contains files from January to April for example
    • Years can't be merged
    • If there are too much files on one day a folder with the day number will be created and added in the month directory

Issues

  • Interface problem in the preview (positionning and progress bar update)
  • In some situations it is possible to find 2014/01-04 and 2014/04

Edit file metadata in command line

touch -t Ymdhm filename

file-organizer's People

Contributors

jbardon avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.