@Test public void getRecursiveFilesIncludesFoldersWithHyphenWhenFalse() throws IOException { Random random = new Random(); int nrOfFiles = random.nextInt(5) + 40; List<File> createdFiles = new ArrayList<>(); for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "recfile" + i); createdFiles.add(file); assertTrue(file.createNewFile()); } for (int i = 0; i < nrOfFiles; i++) { File file = new File(plugin.getDataFolder(), "-recfile" + i); createdFiles.add(file); assertTrue(file.createNewFile()); } List<File> files = FileUtils.getRecursiveFiles(false, plugin); Collections.sort(createdFiles); Collections.sort(files); assertEquals(createdFiles, files); }
@NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); } }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }  }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }  static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSafely(@NotNull File file); static boolean createFolder(@NotNull Plugin plugin, @NotNull String... children); static boolean createFolderSafely(@NotNull File folder); static boolean writeFromInternal(Plugin plugin, String[] externalPath, String... internalPath); static boolean writeFromInternal(Plugin plugin, String[] externalPath, Class<?> resourceClass,
                                            String... internalPath); static boolean writeFromInternal(Plugin plugin, Class<?> resourceClass, String... path); static boolean writeFromInternal(Plugin plugin, String... path); static boolean writeFromInternal(File outFile, String... internalPath); static boolean writeFromInternal(File outFile, Class<?> resourceClass, String... internalPath); static boolean write(@NotNull String string, @NotNull Plugin plugin, @NotNull String... path); static boolean write(@NotNull String string, @NotNull File file); static boolean save(@NotNull InputStream in, @NotNull Plugin plugin, @NotNull String... path); static boolean save(@NotNull InputStream in, @NotNull File file); static String[] splitAtSlash(String path); @NotNull static String joinPath(String... path); @NotNull static String joinPath(boolean abs, String... path); @NotNull static String joinPath(char delimiter, boolean abs, String... path); static void extractInternalFolder(@NotNull Plugin plugin, @NotNull File file, @NotNull String... folderPath); @NotNull static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); @Nullable static String read(@NotNull Plugin plugin, @NotNull String... path); @Nullable static String read(@NotNull File file); @Nullable static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath); @Nullable static List<File> getFiles(@NotNull File folder); @Nullable static List<String> getFileNames(@NotNull Plugin plugin, @NotNull String... subPath); @NotNull static List<String> getFileNames(@NotNull List<File> files); @NotNull static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin,
                                               @NotNull String... children); @NotNull static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull File file); @Nullable static InputStream getInternalFileStream(@NotNull String... absPath); @Nullable static InputStream getInternalFileStream(@NotNull Class<?> resourceClass, @NotNull String... absPath); @Nullable static String readInternalFile(@NotNull String... absPath); @Nullable static String readInternalFile(@NotNull Class<?> resourceClass, @NotNull String... absPath); }
FileUtils { @NotNull public static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin, @NotNull String... children) { return getRecursiveFiles(excludeHyphenPrefix, getDatafolderFile(plugin, children)); }  static boolean createParentFolders(@NotNull File file); @NotNull static File createDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); static void createFileSafely(@NotNull File file); static boolean createFolder(@NotNull Plugin plugin, @NotNull String... children); static boolean createFolderSafely(@NotNull File folder); static boolean writeFromInternal(Plugin plugin, String[] externalPath, String... internalPath); static boolean writeFromInternal(Plugin plugin, String[] externalPath, Class<?> resourceClass,
                                            String... internalPath); static boolean writeFromInternal(Plugin plugin, Class<?> resourceClass, String... path); static boolean writeFromInternal(Plugin plugin, String... path); static boolean writeFromInternal(File outFile, String... internalPath); static boolean writeFromInternal(File outFile, Class<?> resourceClass, String... internalPath); static boolean write(@NotNull String string, @NotNull Plugin plugin, @NotNull String... path); static boolean write(@NotNull String string, @NotNull File file); static boolean save(@NotNull InputStream in, @NotNull Plugin plugin, @NotNull String... path); static boolean save(@NotNull InputStream in, @NotNull File file); static String[] splitAtSlash(String path); @NotNull static String joinPath(String... path); @NotNull static String joinPath(boolean abs, String... path); @NotNull static String joinPath(char delimiter, boolean abs, String... path); static void extractInternalFolder(@NotNull Plugin plugin, @NotNull File file, @NotNull String... folderPath); @NotNull static File getDatafolderFile(@NotNull Plugin plugin, @NotNull String... children); @Nullable static String read(@NotNull Plugin plugin, @NotNull String... path); @Nullable static String read(@NotNull File file); @Nullable static List<File> getFiles(@NotNull Plugin plugin, @NotNull String... subPath); @Nullable static List<File> getFiles(@NotNull File folder); @Nullable static List<String> getFileNames(@NotNull Plugin plugin, @NotNull String... subPath); @NotNull static List<String> getFileNames(@NotNull List<File> files); @NotNull static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull Plugin plugin,
                                               @NotNull String... children); @NotNull static List<File> getRecursiveFiles(boolean excludeHyphenPrefix, @NotNull File file); @Nullable static InputStream getInternalFileStream(@NotNull String... absPath); @Nullable static InputStream getInternalFileStream(@NotNull Class<?> resourceClass, @NotNull String... absPath); @Nullable static String readInternalFile(@NotNull String... absPath); @Nullable static String readInternalFile(@NotNull Class<?> resourceClass, @NotNull String... absPath); static Logger logger; }