@Override public void init(ServletConfig config) throws ServletException { super.init(config); setup = newTestSetup(); if ("true".equals(System.getProperty("benchmarkServiceEnabled"))) { int numberOfRootCategories = getRequiredIntegerConfig(config, NUMBER_OF_ROOT_CATEGORIES); int numberOfLevel1Categories = getRequiredIntegerConfig(config, NUMBER_OF_LEVEL1_CATEGORIES); int numberOfLevel2Categories = getRequiredIntegerConfig(config, NUMBER_OF_LEVEL2_CATEGORIES); int numberOfLevel1AdministrativeUnits = getRequiredIntegerConfig(config, NUMBER_OF_LEVEL1_ADMINISTRATIVE_UNITS); int numberOfLevel2AdministrativeUnits = getRequiredIntegerConfig(config, NUMBER_OF_LEVEL2_ADMINISTRATIVE_UNITS); int numberOfFolders = getRequiredIntegerConfig(config, NUMBER_OF_FOLDERS); String contentSamplesFilepath = getRequiredConfig(config, CONTENT_SAMPLES); setup.initializeCollectionIfRequired( numberOfRootCategories, numberOfLevel1Categories, numberOfLevel2Categories, numberOfLevel1AdministrativeUnits, numberOfLevel2AdministrativeUnits, numberOfFolders, COLLECTION); setCategoriesAndClassificationIdsList(); IOFileFilter fileFilter = new IOFileFilter() { @Override public boolean accept(File file) { return true; } @Override public boolean accept(File dir, String name) { return true; } }; File contentSamplesFile = new File(contentSamplesFilepath); if (!contentSamplesFile.exists()) { throw new RuntimeException("Folder '" + contentSamplesFilepath + "' does not exist"); } Collection<File> files = FileUtils.listFiles(contentSamplesFile, fileFilter, fileFilter); if (files == null || files.isEmpty()) { throw new RuntimeException("Folder '" + contentSamplesFilepath + "' is empty"); } allPdfFiles = new ArrayList<>(files); } }