@Test public void system_size() throws IOException, CompressorException, ArchiveException { ProcessingManager mgr = new ProcessingManager(); long size = mgr.system_size(sample); Assert.assertEquals(size, 494928); File folder=sample.getParentFile(); File extaction_folder=new File(folder, "unzip"); extaction_folder.mkdirs(); UnZip.unCompress(sample.getAbsolutePath(), extaction_folder.getAbsolutePath()); File tocheck = extaction_folder.listFiles()[0]; size = mgr.system_size(tocheck); Assert.assertEquals(size, SIZE, tocheck.getAbsolutePath()); }
long system_size (File file) { long size=0; if (file.isDirectory()) { for (File subFile : file.listFiles ()) { size += system_size (subFile); } } else { size = file.length (); } return size; }
ProcessingManager { long system_size (File file) { long size=0; if (file.isDirectory()) { for (File subFile : file.listFiles ()) { size += system_size (subFile); } } else { size = file.length (); } return size; } }
ProcessingManager { long system_size (File file) { long size=0; if (file.isDirectory()) { for (File subFile : file.listFiles ()) { size += system_size (subFile); } } else { size = file.length (); } return size; }  }
ProcessingManager { long system_size (File file) { long size=0; if (file.isDirectory()) { for (File subFile : file.listFiles ()) { size += system_size (subFile); } } else { size = file.length (); } return size; }  @Transactional Product process(Product product); }
ProcessingManager { long system_size (File file) { long size=0; if (file.isDirectory()) { for (File subFile : file.listFiles ()) { size += system_size (subFile); } } else { size = file.length (); } return size; }  @Transactional Product process(Product product);  }