equal
deleted
inserted
replaced
32 import java.nio.file.Path; |
32 import java.nio.file.Path; |
33 import java.nio.file.SimpleFileVisitor; |
33 import java.nio.file.SimpleFileVisitor; |
34 import java.nio.file.attribute.BasicFileAttributes; |
34 import java.nio.file.attribute.BasicFileAttributes; |
35 import java.util.ArrayList; |
35 import java.util.ArrayList; |
36 import java.util.List; |
36 import java.util.List; |
37 import java.util.Arrays; |
37 import java.util.stream.Collectors; |
|
38 import java.util.stream.Stream; |
38 |
39 |
39 import java.util.spi.ToolProvider; |
40 import java.util.spi.ToolProvider; |
40 |
41 |
41 public class JPackageHelper { |
42 public class JPackageHelper { |
42 |
43 |
567 public static String [] splitAndFilter(String output) { |
568 public static String [] splitAndFilter(String output) { |
568 if (output == null) { |
569 if (output == null) { |
569 return null; |
570 return null; |
570 } |
571 } |
571 |
572 |
572 String[] result = output.split("\n"); |
573 return Stream.of(output.split("\\R")) |
573 if (result == null || result.length == 0) { |
574 .filter(str -> !str.startsWith("Picked up")) |
574 return result; |
575 .filter(str -> !str.startsWith("WARNING: Using experimental")) |
575 } |
576 .filter(str -> !str.startsWith("hello: ")) |
576 |
577 .collect(Collectors.toList()).toArray(String[]::new); |
577 List<String> origList = new ArrayList(Arrays.asList(result)); |
|
578 List<String> newlist = new ArrayList(); |
|
579 origList.stream().filter((str) -> |
|
580 (!str.startsWith("Picked up") && |
|
581 !str.startsWith("WARNING: Using experimental"))) |
|
582 .forEachOrdered((str) -> { |
|
583 newlist.add(str); |
|
584 }); |
|
585 |
|
586 return newlist.toArray(new String[newlist.size()]); |
|
587 } |
578 } |
588 |
579 |
589 private static String quote(String in, boolean toolProvider) { |
580 private static String quote(String in, boolean toolProvider) { |
590 if (in == null) { |
581 if (in == null) { |
591 return null; |
582 return null; |