diff --git a/src/main/java/cc/ryanc/halo/utils/ThemeUtils.java b/src/main/java/cc/ryanc/halo/utils/ThemeUtils.java index f2c8c508b..08ca12e34 100644 --- a/src/main/java/cc/ryanc/halo/utils/ThemeUtils.java +++ b/src/main/java/cc/ryanc/halo/utils/ThemeUtils.java @@ -184,6 +184,22 @@ public class ThemeUtils { return result; } + /** + * Judging whether theme exists under template path + * + * @param theme theme name + * @return boolean + * @throws FileNotFoundException FileNotFoundException + */ + public static boolean isThemeExist(String theme) throws FileNotFoundException { + boolean result = false; + File file = new File(getThemesPath(theme), theme); + if (file.exists()) { + result = true; + } + return result; + } + /** * Judging whether the theme is a internal theme or not *