Skip to content

Commit

Permalink
Fix FileTest seperator in Win (#10992)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Nov 22, 2022
1 parent f074aec commit 10d9e9f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -416,7 +417,7 @@ public void readSPI(File path, List<String> spis) {
absolutePath = absolutePath.substring(absolutePath.lastIndexOf("src" + File.separator + "main" + File.separator + "java" + File.separator)
+ ("src" + File.separator + "main" + File.separator + "java" + File.separator).length());
absolutePath = absolutePath.substring(0, absolutePath.lastIndexOf(".java"));
absolutePath = absolutePath.replaceAll(File.separator, ".");
absolutePath = absolutePath.replaceAll(Matcher.quoteReplacement(File.separator), ".");
spis.add(absolutePath);
}
}
Expand All @@ -439,7 +440,7 @@ public void readSPIResource(File path, Map<File, String> spis) {
String absolutePath = path.getAbsolutePath();
absolutePath = absolutePath.substring(absolutePath.lastIndexOf("src" + File.separator + "main" + File.separator + "resources" + File.separator + "META-INF" + File.separator + "dubbo" + File.separator + "internal" + File.separator)
+ ("src" + File.separator + "main" + File.separator + "resources" + File.separator + "META-INF" + File.separator + "dubbo" + File.separator + "internal" + File.separator).length());
absolutePath = absolutePath.replaceAll( File.separator, ".");
absolutePath = absolutePath.replaceAll(Matcher.quoteReplacement(File.separator), ".");
spis.put(path, absolutePath);
}
}
Expand Down

0 comments on commit 10d9e9f

Please sign in to comment.