@Test public void testGetCountFiles() throws IOException { final File destDir = buildOrnidroidHomeTest(TEST_DIRECTORY + "/destDir"); int countFiles = FileHelper.getCountFiles(destDir); Assert.assertEquals("6 files expected", 6, countFiles); }
public static int getCountFiles(File fileToCheck) { int count = 0; if (fileToCheck != null && fileToCheck.isDirectory()) { File[] listOfFiles = fileToCheck.listFiles(); if (listOfFiles != null) { count = listOfFiles.length; for (int i = 0; i < listOfFiles.length; i++) { count += getCountFiles(listOfFiles[i]); } } } return count; }
FileHelper { public static int getCountFiles(File fileToCheck) { int count = 0; if (fileToCheck != null && fileToCheck.isDirectory()) { File[] listOfFiles = fileToCheck.listFiles(); if (listOfFiles != null) { count = listOfFiles.length; for (int i = 0; i < listOfFiles.length; i++) { count += getCountFiles(listOfFiles[i]); } } } return count; } }
FileHelper { public static int getCountFiles(File fileToCheck) { int count = 0; if (fileToCheck != null && fileToCheck.isDirectory()) { File[] listOfFiles = fileToCheck.listFiles(); if (listOfFiles != null) { count = listOfFiles.length; for (int i = 0; i < listOfFiles.length; i++) { count += getCountFiles(listOfFiles[i]); } } } return count; } private  FileHelper(); }
FileHelper { public static int getCountFiles(File fileToCheck) { int count = 0; if (fileToCheck != null && fileToCheck.isDirectory()) { File[] listOfFiles = fileToCheck.listFiles(); if (listOfFiles != null) { count = listOfFiles.length; for (int i = 0; i < listOfFiles.length; i++) { count += getCountFiles(listOfFiles[i]); } } } return count; } private  FileHelper(); static void createEmptyFile(final File file); static int folderSize(File directory, boolean recursive); static void doCopyFile(final File srcFile, final File destFile); static void forceDelete(final File file); static void forceMkdir(final File directory); static void moveDirectory(final File srcDir, final File destDir); static String[] parseContentFile(final File contentFile); static void writeStringToFile(final File file, final String data,
			final Charset encoding, final boolean append); static boolean unzipFile(String zipname, String destDir); static int getFileSizeInMb(File downloadedFile); static int getCountFiles(File fileToCheck); }
FileHelper { public static int getCountFiles(File fileToCheck) { int count = 0; if (fileToCheck != null && fileToCheck.isDirectory()) { File[] listOfFiles = fileToCheck.listFiles(); if (listOfFiles != null) { count = listOfFiles.length; for (int i = 0; i < listOfFiles.length; i++) { count += getCountFiles(listOfFiles[i]); } } } return count; } private  FileHelper(); static void createEmptyFile(final File file); static int folderSize(File directory, boolean recursive); static void doCopyFile(final File srcFile, final File destFile); static void forceDelete(final File file); static void forceMkdir(final File directory); static void moveDirectory(final File srcDir, final File destDir); static String[] parseContentFile(final File contentFile); static void writeStringToFile(final File file, final String data,
			final Charset encoding, final boolean append); static boolean unzipFile(String zipname, String destDir); static int getFileSizeInMb(File downloadedFile); static int getCountFiles(File fileToCheck); static final long ONE_KB; static final long ONE_MB; }