@Test void isIn() { Assertions.assertTrue(FileUtils.contains(directory.listFiles(), "a")); Assertions.assertFalse(FileUtils.contains(directory.listFiles(), "d")); }
public static boolean contains(File[] files, String fileName) { return Arrays.stream(files).anyMatch(file -> file.getName().equals(fileName)); }
FileUtils { public static boolean contains(File[] files, String fileName) { return Arrays.stream(files).anyMatch(file -> file.getName().equals(fileName)); } }
FileUtils { public static boolean contains(File[] files, String fileName) { return Arrays.stream(files).anyMatch(file -> file.getName().equals(fileName)); } private  FileUtils(); }
FileUtils { public static boolean contains(File[] files, String fileName) { return Arrays.stream(files).anyMatch(file -> file.getName().equals(fileName)); } private  FileUtils(); static boolean contains(File[] files, String fileName); static int getAmountOfFiles(File directory); static String getContentOfFile(File file); static String[] getContentAsLines(File file); static Collection<File> findFilesByExtension(String directory, String extension); static Collection<File> findFilesByExtension(File directory, String extension); static Node<File> collectFiles(File directory); static void overrideFile(File file, String content); static boolean delete(File file); static File[] toFiles(String... paths); static String getName(File file); static String getName(URL url); static String getName(String path); }
FileUtils { public static boolean contains(File[] files, String fileName) { return Arrays.stream(files).anyMatch(file -> file.getName().equals(fileName)); } private  FileUtils(); static boolean contains(File[] files, String fileName); static int getAmountOfFiles(File directory); static String getContentOfFile(File file); static String[] getContentAsLines(File file); static Collection<File> findFilesByExtension(String directory, String extension); static Collection<File> findFilesByExtension(File directory, String extension); static Node<File> collectFiles(File directory); static void overrideFile(File file, String content); static boolean delete(File file); static File[] toFiles(String... paths); static String getName(File file); static String getName(URL url); static String getName(String path);  }