From 502b48682bba21868466ddbf0a9f6c3ae19abe87 Mon Sep 17 00:00:00 2001 From: Laszlo Magyar Date: Thu, 6 Jun 2024 00:29:07 +0200 Subject: [PATCH] fix virtual folder names - again --- .../src/org/primftpd/filesystem/VirtualFile.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/primitiveFTPd/src/org/primftpd/filesystem/VirtualFile.java b/primitiveFTPd/src/org/primftpd/filesystem/VirtualFile.java index 27d0bb24..811abb7e 100644 --- a/primitiveFTPd/src/org/primftpd/filesystem/VirtualFile.java +++ b/primitiveFTPd/src/org/primftpd/filesystem/VirtualFile.java @@ -21,7 +21,7 @@ public VirtualFile( PftpdService pftpdService) { super( absPath, - delegate != null ? delegate.getName() : absPath, + delegate != null ? delegate.getName() : absPath.length() > 1 && absPath.charAt(0) == '/' ? absPath.substring(1) : absPath, delegate != null ? delegate.getLastModified() : 0, delegate != null ? delegate.getSize() : 0, delegate == null || delegate.isReadable(), @@ -82,10 +82,10 @@ public boolean delete() { public List listFiles() { if ("/".equals(absPath)) { List files = new ArrayList<>(4); - files.add(createFile(VirtualFileSystemView.PREFIX_FS, null, pftpdService)); - files.add(createFile(VirtualFileSystemView.PREFIX_ROOT, null, pftpdService)); - files.add(createFile(VirtualFileSystemView.PREFIX_SAF, null, pftpdService)); - files.add(createFile(VirtualFileSystemView.PREFIX_ROSAF, null, pftpdService)); + files.add(createFile("/" + VirtualFileSystemView.PREFIX_FS, null, pftpdService)); + files.add(createFile("/" + VirtualFileSystemView.PREFIX_ROOT, null, pftpdService)); + files.add(createFile("/" + VirtualFileSystemView.PREFIX_SAF, null, pftpdService)); + files.add(createFile("/" + VirtualFileSystemView.PREFIX_ROSAF, null, pftpdService)); return Collections.unmodifiableList(files); } return listDelegateFiles();