From ad59d02549932d41450688f44bbd61adba2869b8 Mon Sep 17 00:00:00 2001 From: AozoraDev Date: Sat, 11 Nov 2023 01:46:55 +0800 Subject: [PATCH] Add (DIR) label to file list --- lib/src/main/java/com/harubyte/mitobi/Mitobi.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/main/java/com/harubyte/mitobi/Mitobi.java b/lib/src/main/java/com/harubyte/mitobi/Mitobi.java index 58d778f..d1fb6be 100644 --- a/lib/src/main/java/com/harubyte/mitobi/Mitobi.java +++ b/lib/src/main/java/com/harubyte/mitobi/Mitobi.java @@ -291,7 +291,8 @@ private String getFilesList(File files) { StringBuilder sb = new StringBuilder(); for (File file : files.listFiles()) { String path = file.getAbsolutePath().replaceAll(mainPath, ""); - sb.append("\n- " + path); + sb.append("\n- " + path + " "); + sb.append(file.isDirectory() ? "(DIR)" : ""); if (file.isDirectory() && file.list().length > 0) sb.append(getFilesList(file)); }