/** * The JVM requires a static main() entry point to run the console version of * the ImageTaskGang app. */ public static void main(String[] args) { System.out.println("Starting ImageTaskGangTest"); // Initializes the Options singleton. Options.instance().parseArgs(args); // Run all the tests. runTests(); System.out.println("Ending ImageTaskGangTest"); }
/** * Clears the filter directories. */ private static void deleteFilteredImages() { int deletedFiles = 0; // Delete all the filter directories. for (Filter filter : mFilters) deletedFiles += deleteSubFolders (new File(Options.instance().getDirectoryPath(), filter.getName()).getAbsolutePath()); System.out.println(deletedFiles + " previously downloaded file(s) deleted"); }
/** * Warm up the threads in the thread pool so the timing results * will be more accurate. */ private static void warmUpThreadPool() { System.out.println("Warming up the thread pool"); // Delete any the filtered images from the previous run. deleteFilteredImages(); // Create and run the ImageTaskCompletionServiceFixed test to // warm up threads in the thread pool. ImageTaskGang taskGang = new ImageTaskCompletionServiceFixed(mFilters, Options.instance().getUrlLists()); taskGang.run(); // Run the garbage collector to avoid perturbing the test. System.gc(); System.out.println("End warming up the thread pool"); }
File externalFile = new File(Options.instance().getDirectoryPath(), this.getName()); externalFile.mkdirs();
Options.instance().getUrlLists();