This commit is contained in:
crschnick
2024-08-24 12:42:06 +00:00
parent d6cb3bf2bd
commit 27e6fc10e0
40 changed files with 284 additions and 177 deletions
@@ -25,18 +25,23 @@ public class FileEntry {
String path;
public FileEntry(
FileSystem fileSystem, @NonNull String path, Instant date, long size, FileInfo info, @NonNull FileKind kind
) {
FileSystem fileSystem,
@NonNull String path,
Instant date,
long size,
FileInfo info,
@NonNull FileKind kind) {
this.fileSystem = fileSystem;
this.kind = kind;
this.path = kind == FileKind.DIRECTORY ? new FilePath(path).toDirectory().toString() : path;
this.path =
kind == FileKind.DIRECTORY ? new FilePath(path).toDirectory().toString() : path;
this.date = date;
this.info = info;
this.size = size;
}
public static FileEntry ofDirectory(FileSystem fileSystem, String path) {
return new FileEntry(fileSystem, path, Instant.now(), 0, null, FileKind.DIRECTORY);
return new FileEntry(fileSystem, path, Instant.now(), 0, null, FileKind.DIRECTORY);
}
public FileEntry resolved() {
@@ -66,5 +66,4 @@ public interface FileSystem extends Closeable, AutoCloseable {
}
List<String> listRoots() throws Exception;
}
@@ -14,10 +14,13 @@ public class LinkFileEntry extends FileEntry {
FileEntry target;
public LinkFileEntry(
FileSystem fileSystem, @NonNull String path, Instant date, long size, @NonNull FileInfo info,
@NonNull FileEntry target
) {
super(fileSystem, path, date, size, info, FileKind.LINK);
FileSystem fileSystem,
@NonNull String path,
Instant date,
long size,
@NonNull FileInfo info,
@NonNull FileEntry target) {
super(fileSystem, path, date, size, info, FileKind.LINK);
this.target = target;
}