FolderFileWin - ViiSE/papka GitHub Wiki

FolderFileWin

FolderFileWin - Folder with java.io.File files from raw files from Windows.

Constructors

public FolderFileWin(String... rawFiles)


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


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


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


boolean excludeNonExisting - is exclude non-existent files or not? (default - false);
boolean isUnixLike - raw files is unix like or not? (default - false);
String... rawFiles - save varargs raw files.
public FolderFileWin(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 FolderFileWin(Name name, boolean excludeNonExisting, boolean isUnixLike, String... rawFiles)


Name name - folder name (default - NameFolderRoot);
boolean excludeNonExisting - is exclude non-existent files or not? (default - false);
boolean isUnixLike - raw files is unix like or not? (default - false);
String... rawFiles - save varargs raw files.
public FolderFileWin(List<String> rawFiles)


List<String> rawFiles - list of raw files.
public FolderFileWin(List<String> rawFiles, boolean excludeNonExisting)


List<String> rawFiles - list of raw files;
boolean excludeNonExisting - is exclude non-existent files or not? (default - false).
FolderFileWin(List<String> rawFiles, boolean excludeNonExisting, boolean isUnixLike)


List<String> rawFiles - list of raw files;
boolean excludeNonExisting - is exclude non-existent files or not? (default - false);
boolean isUnixLike - raw files is unix like or not? (default - false).
public FolderFileWin(Name name, List<String> rawFiles)


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


Name name - folder name (default - NameFolderRoot);
List<String> rawFiles - list of raw files;
boolean excludeNonExisting - is exclude non-existent files or not? (default - false).
public FolderFileWin(Name name, List<String> rawFiles, boolean excludeNonExisting, boolean isUnixLike)


Name name - folder name (default - NameFolderRoot);
List<String> rawFiles - list of raw files;
boolean excludeNonExisting - is exclude non-existent files or not? (default - false);
boolean isUnixLike - raw files is unix like or not? (default - false).

Example

Folder<File> root = new FolderFileWin(
                "C:\\root1.txt",
                "C:\\root2.txt",
                "C:\\root3",
                "C:\\music\\audio1.mp3",
                "C:\\music\\audio2.mp3",
                "C:\\music\\opus\\02.flac",
                "C:\\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:
Children:
    C:
Full Name: /\C:
Short Name: C:
Files:
    root1.txt
    root2.txt,
    root3
Children:
    music

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

Links

Folder - implementable interface.

NameFolderRoot - default value constructor.

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