Skip to content

How it works?

ViiSE edited this page Jul 22, 2020 · 2 revisions

How it works?

To understand how Papka works, let's look at an example. We have raw files list like this:

/music/sound1.mp3
/music/sound2.mp3
/music/sound3.mp3
/music/opus/o1.mp3
/music/opus/o2.mp3
/doc/table.xslx
/doc/doc.docx
/doc/present.pptx
/diary

After instantiating Folder and first calling one of its methods, the following occurs:

  1. An instance of Map is created in which the key is the full name of the folder and the value is the list of files of this folder (In alphabet order).
  1. Folders full name split separator / and creates instances of Folder. For example, folder /music/opus/ will turn into /music folder, which contains opus folder, i.e. opus is a child of music. Files of music is sound1.mp3, sound2.mp3, sound3.mp3, and files of opus is o1.mp3 and o2.mp3. Thus, we get the following Java-object:
Clone this wiki locally