FolderFile - ViiSE/papka GitHub Wiki

FolderFile

FolderFile - Folder with java.io.File files from raw files.

Constructors

public FolderFile(String... rawFiles)


String... rawFiles - save varargs raw files.
public FolderFile(Name name, String... rawFiles)


Name name - folder name (default - NameFolderRoot);
String... rawFiles - save varargs raw files.
public FolderFile(boolean excludeNonExisting, String... rawFiles)


boolean excludeNonExisting - is exclude non-existent files or not? (default - false);
String... rawFiles - save varargs raw files.
public FolderFile(Name name, boolean excludeNonExisting, String... rawFiles)


Name name - folder name (default - NameFolderRoot);
boolean excludeNonExisting - is exclude non-existent files or not? (default - false);
String... rawFiles - save varargs raw files.
public FolderFile(Name name, FoldersFile<String, String> foldersFile, boolean excludeNonExisting, String... rawFiles)


Name name - folder name (default - NameFolderRoot);
FoldersFile<String, String> foldersFile - folders name of file (default - FoldersFileName);
boolean excludeNonExisting - is exclude non-existent files or not? (default - false);
String... rawFiles - save varargs raw files.
public FolderFile(List<String> rawFiles)


List<String> rawFiles - list of raw files.
public FolderFile(Name name, List<String> rawFiles)


Name name - folder name (default - NameFolderRoot);
List<String> rawFiles - list of raw files.
public FolderFile(Name name, List<String> rawFiles, FoldersFile<String, String> foldersFile, boolean excludeNonExisting)


Name name - folder name (default - NameFolderRoot);
List<String> rawFiles - list of raw files;
FoldersFile<String, String> foldersFile - folders name of file (default - FoldersFileName);
boolean excludeNonExisting - is exclude non-existent files or not? (default - false).
public FolderFile(Name name, TreeFolder<File> trFolder)


Name name - folder name (default - NameFolderRoot);
TreeFolder<File> trFolder - for building tree folder from full file names (default TreeFolderPure).

Example

Folder<File> root = new FolderFile(
                "/root1.txt",
                "/root2.txt",
                "/root3",
                "/music/audio1.mp3",
                "/music/audio2.mp3",
                "/music/opus/02.flac",
                "/music/opus/o1");

root.travel(folder -> {
    System.out.println("Full Name: " + folder.fullName()); 
    System.out.println("Short Name: " + folder.shortName());
    System.out.println("Files:");
    folder.files().forEach(file -> System.out.println("\t" + file.getName()));
    System.out.println("Children:");
    folder.children().forEach(child -> System.out.println("\t" + child.shortName()));
    System.out.println();
});
Output:

Full Name: /
Short Name: /
Files:
    root1.txt
    root2.txt,
    root3
Children:
    music

Full Name: /music
Short Name: music
Files:
    audio1.mp3
    audio2.mp3
Children:
    opus
Full Name: /music/opus
Short Name: opus
Files:
    02.flac
    o1
Children:

Links

Folder - implementable interface.

NameFolderRoot - default value constructor.

FoldersFile - default value constructor.

⚠️ **GitHub.com Fallback** ⚠️