File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
main/java/edu/ie3/datamodel/io
test/groovy/edu/ie3/datamodel/io/source/csv Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ public static String harmonizeFileSeparator(String in) {
3737 * @return the option for a harmonized path
3838 */
3939 public static Path harmonizeFileSeparator (Path path ) {
40- return Path .of (IoUtil .harmonizeFileSeparator (path .toString ()));
40+ String in = path .toString ();
41+
42+ if (in .length () > 0 && FILE_SEPARATOR_REGEX .contains (in .substring (0 , 1 ))) {
43+ in = in .replaceFirst ("^" + IoUtil .FILE_SEPARATOR_REGEX , "" );
44+ }
45+
46+ return Path .of (
47+ IoUtil .harmonizeFileSeparator (in .replaceAll (IoUtil .FILE_SEPARATOR_REGEX + "$" , "" )));
4148 }
4249
4350 /**
Original file line number Diff line number Diff line change @@ -51,6 +51,6 @@ trait CsvTestDataMeta {
5151 FileNamingStrategy fileNamingStrategy = new FileNamingStrategy ()
5252
5353 Path getResourceAbs(String directory) {
54- return Path . of(getClass() . getResource(directory). toURI())
54+ return Path . of(CsvTestDataMeta . getResource(directory). toURI())
5555 }
5656}
You can’t perform that action at this time.
0 commit comments