From 21a723ef38eaa965717b815a221442072535746d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Ko=C5=BEusznik?= <jan@kozusznik.cz>
Date: Thu, 12 Jul 2018 11:10:12 +0200
Subject: [PATCH] fix: download statistics with results

---
 .../core/BenchmarkJobManager.java                | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java
index c88e3c5f..79bd6a57 100644
--- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java
+++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/BenchmarkJobManager.java
@@ -422,7 +422,7 @@ public class BenchmarkJobManager implements Closeable {
 						Set<String> otherFiles = extractNames(getOutputDirectory().resolve(mainFile));
 						try {
 							return job
-									.startDownload(downloadFileNameExtractDecorator(name -> otherFiles.contains(name)));
+									.startDownload(downloadFileNameExtractDecorator( downloadCSVDecorator( name -> otherFiles.contains(name))));
 						} catch (IOException e) {
 							throw new RuntimeException(e);
 						}
@@ -670,7 +670,7 @@ public class BenchmarkJobManager implements Closeable {
 				.walltimeLimit(Constants.HAAS_TIMEOUT).numberOfCoresPerNode(Constants.CORES_PER_NODE).build();
 	}
 
-	private static Predicate<String> downloadFileNameExtractDecorator(Predicate<String> decorated) {
+	static private Predicate<String> downloadFileNameExtractDecorator(Predicate<String> decorated) {
 		return name -> {
 			Path path = getPathSafely(name);
 			if (path == null)
@@ -680,8 +680,18 @@ public class BenchmarkJobManager implements Closeable {
 			return decorated.test(fileName);
 		};
 	}
+	
+	static private Predicate<String> downloadCSVDecorator(Predicate<String> decorated) {
+		return name -> {
+			if(name.toLowerCase().endsWith(".csv")) {
+				return true;
+			}
+			return decorated.test(name);
+		};
+		
+	}
 
-	private static Predicate<String> downloadFailedData() {
+	static private Predicate<String> downloadFailedData() {
 		return name -> {
 			Path path = getPathSafely(name);
 			if (path == null)
-- 
GitLab