Project for sorting list of directories for necessary rules.
We have a List with many values like a "/1_ex/example.feature". Directories can be with a multi level hierarchy, also include english and russian symbols and numbers.
Our goal it is sorting input list for some rules:
- Directories higher than files
- Directories and files must be sorted alphabetically, separately from each other, for the same nesting level
- Case insensitive
- Numbers sensitive
- These four rules must apply for any level nested
Output list:
/1_a/1_Test.feature
/10_d/2_Test.feature
/11_e/11_Test.feature
/atlas/brash/aorting.feature
/atlas/brash/gorting.feature
/atlas/trash/ban/1_yorting.feature
/atlas/trash/ban/2_yorting.feature
/atlas/trash/ban/10_yorting.feature
/atlas/trash/ban/worting.feature
/atlas/trash/ban/yorting.feature
/atlas/trash/bang/worting.feature
/atlas/trash/aorting.feature
/atlas/corting.feature
/cards/exampleForCardsTeam.feature
/cards/Выпуск.feature
/BackSystemsDisable.feature
/example.feature
Setup
For work you need two classes - DirectoriesSorter and TrueListComparator.
Then call DirectoriesSorter.sortDirs(list).