use system property path.separator and fix failing unit test on windows

This commit is contained in:
Armin Schrenk
2023-07-04 16:31:28 +02:00
parent 11a0136cb9
commit 2c984ad405
2 changed files with 27 additions and 3 deletions

View File

@@ -5,7 +5,6 @@ import com.google.common.base.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -131,7 +130,7 @@ public class Environment {
// visible for testing
Stream<Path> getPaths(String propertyName) {
Stream<String> rawSettingsPaths = getRawList(propertyName, File.pathSeparatorChar);
Stream<String> rawSettingsPaths = getRawList(propertyName, System.getProperty("path.separator").charAt(0));
return rawSettingsPaths.filter(Predicate.not(Strings::isNullOrEmpty)).map(Path::of);
}