class ExecutionService {

    List<File> retrieveAllExecutionDirectories(File file, String buildInformationFilePath) {
        if (ArrayUtils.isEmpty(file.list())) {
            log.warn("No entries found in the zip file {}", file.getAbsolutePath());
            return new ArrayList<>();
        }

        if (isExecutionDirectory(file, buildInformationFilePath)) {
            return Collections.singletonList(file);
        }

        List<File> executionDirectories = new ArrayList<>();
        File[] entries = file.listFiles();
        if (null != entries) {
            executionDirectories = Arrays.asList(entries).stream()
                    .filter(f -> isExecutionDirectory(f, buildInformationFilePath))
                    .collect(Collectors.toList());
        }
        return executionDirectories;
    }

}