|
9 | 9 | import edu.wpi.grip.core.util.ExceptionWitness; |
10 | 10 | import edu.wpi.grip.core.util.ImageLoadingUtility; |
11 | 11 |
|
12 | | -import com.google.common.base.Throwables; |
13 | 12 | import com.google.common.collect.ImmutableList; |
14 | 13 | import com.google.common.eventbus.EventBus; |
15 | 14 | import com.google.common.math.IntMath; |
|
22 | 21 | import java.io.File; |
23 | 22 | import java.io.IOException; |
24 | 23 | import java.io.UnsupportedEncodingException; |
25 | | -import java.net.URLDecoder; |
26 | | -import java.nio.charset.StandardCharsets; |
27 | | -import java.nio.file.Paths; |
28 | 24 | import java.util.Arrays; |
29 | 25 | import java.util.List; |
30 | 26 | import java.util.Optional; |
31 | 27 | import java.util.Properties; |
32 | 28 | import java.util.concurrent.atomic.AtomicInteger; |
33 | | -import java.util.stream.Collectors; |
34 | 29 |
|
35 | 30 | import static com.google.common.base.Preconditions.checkElementIndex; |
36 | 31 |
|
@@ -66,15 +61,15 @@ public final class MultiImageFileSource extends Source implements PreviousNext { |
66 | 61 | final ExceptionWitness.Factory exceptionWitnessFactory, |
67 | 62 | @Assisted final List<File> files, |
68 | 63 | @Assisted final int index) throws UnsupportedEncodingException { |
69 | | - this(eventBus, outputSocketFactory, exceptionWitnessFactory, files.stream() |
70 | | - .map(file -> { |
71 | | - try { |
72 | | - return URLDecoder.decode(Paths.get(file.toURI()).toString(), |
73 | | - StandardCharsets.UTF_8.name()); |
74 | | - } catch (UnsupportedEncodingException e) { |
75 | | - throw Throwables.propagate(e); |
76 | | - } |
77 | | - }).collect(Collectors.toList()).toArray(new String[files.size()]), index); |
| 64 | + this( |
| 65 | + eventBus, |
| 66 | + outputSocketFactory, |
| 67 | + exceptionWitnessFactory, |
| 68 | + files.stream() |
| 69 | + .map(File::getAbsolutePath) |
| 70 | + .toArray(String[]::new), |
| 71 | + index |
| 72 | + ); |
78 | 73 | } |
79 | 74 |
|
80 | 75 | @AssistedInject |
|
0 commit comments