diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/file/FileUtil.java b/src/main/java/org/esoteric/minecraft/plugins/template/file/FileUtil.java index 4c3727cf..86d49fbc 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/file/FileUtil.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/file/FileUtil.java @@ -80,30 +80,6 @@ public static void zipFolder(@NotNull File sourceFolder, File zipFile) throws IO } } - public static boolean isDirectoryRecursivelyEmpty(@NotNull File directory) { - if (!directory.isDirectory()) { - throw new IllegalArgumentException("The specified path is not a directory"); - } - - File[] files = directory.listFiles(); - - if (files == null || files.length == 0) { - return true; - } - - for (File file : files) { - if (file.isFile()) { - return false; - } else if (file.isDirectory()) { - if (!isDirectoryRecursivelyEmpty(file)) { - return false; - } - } - } - - return true; - } - public static @Nullable String getSha1HexString(File file) { String algorithm = "SHA-1"; diff --git a/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java b/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java index ec87c781..7ff792db 100644 --- a/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java +++ b/src/main/java/org/esoteric/minecraft/plugins/template/resourcepack/ResourcePackManager.java @@ -1,5 +1,6 @@ package org.esoteric.minecraft.plugins.template.resourcepack; +import foundation.esoteric.utility.file.FileUtility; import org.apache.commons.io.FileUtils; import org.esoteric.minecraft.plugins.template.PaperTemplatePlugin; import org.esoteric.minecraft.plugins.template.file.FileUtil; @@ -66,7 +67,7 @@ private void saveResourcepackZipFile() { } File assetsFile = new File(plugin.getDataPath() + File.separator + resourcePackResourceFolderName + File.separator + resourcePackAssetsFolderName); - if (FileUtil.isDirectoryRecursivelyEmpty(assetsFile)) { + if (FileUtility.Companion.isRecursivelyEmpty(assetsFile)) { return; }