Skip to content

Commit e80e4da

Browse files
committed
Update UILoader.
1 parent 2a8ac0f commit e80e4da

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sierra-test/src/main/java/org/httprpc/sierra/test/PreviewTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.IOException;
2323
import java.nio.file.Files;
2424
import java.nio.file.Path;
25+
import java.nio.file.StandardCopyOption;
2526

2627
import static org.httprpc.kilo.util.Collections.*;
2728

@@ -45,7 +46,7 @@ public void run() {
4546

4647
for (var i = 0; i < n; i++) {
4748
try (var inputStream = GreetingTest.class.getResourceAsStream(names.get(i))) {
48-
Files.copy(inputStream, paths.get(i));
49+
Files.copy(inputStream, paths.get(i), StandardCopyOption.REPLACE_EXISTING);
4950
}
5051
}
5152

sierra/src/main/java/org/httprpc/sierra/UILoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ private URL getURL(String value) {
834834
if (owner != null) {
835835
return owner.getClass().getResource(value);
836836
} else {
837-
var uri = path.getParent().resolve(value).toUri();
837+
var uri = path.resolveSibling(value).toUri();
838838

839839
try {
840840
return uri.toURL();

0 commit comments

Comments
 (0)