Skip to content

Commit 0573083

Browse files
authored
Merge pull request #153 from kiegroup/main-sync-20260308
[main-sync-20260308] 🤖 Sync main with upstream
2 parents e9c549d + ee8a350 commit 0573083

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

build-parent/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@
223223
<version.archunit.junit5>1.4.0</version.archunit.junit5>
224224

225225
<version.io.vertx>4.5.23</version.io.vertx>
226-
<version.at.yawk.lz4.java>1.10.1</version.at.yawk.lz4.java>
227226
</properties>
228227

229228
<dependencyManagement>
@@ -234,11 +233,6 @@
234233
<artifactId>vertx-web</artifactId>
235234
<version>${version.io.vertx}</version>
236235
</dependency>
237-
<dependency>
238-
<groupId>at.yawk.lz4</groupId>
239-
<artifactId>lz4-java</artifactId>
240-
<version>${version.at.yawk.lz4.java}</version>
241-
</dependency>
242236
<!-- Version overrides to fix vulnerabilities - end -->
243237

244238
<!-- Keep in sync with groupId org.slf4j -->

kie-maven-plugin/src/main/java/org/kie/maven/plugin/DiskResourceStore.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
*/
1919
package org.kie.maven.plugin;
2020

21+
import org.drools.util.PathUtils;
2122
import org.drools.util.PortablePath;
2223
import org.kie.memorycompiler.resources.ResourceStore;
2324

2425
import java.io.File;
2526
import java.io.IOException;
2627
import java.nio.file.Files;
2728
import java.nio.file.Path;
28-
import java.nio.file.Paths;
2929

3030
public class DiskResourceStore implements ResourceStore {
3131

@@ -77,7 +77,7 @@ public void remove(String pResourceName) {
7777

7878
private void commonWrite(String fullPath, byte[] pResourceData, boolean createFolder) {
7979
try {
80-
final Path path = Paths.get(fullPath).normalize();
80+
final Path path = PathUtils.getSecuredPath(root.toPath(), fullPath);
8181
if (createFolder) {
8282
final Path parentPath = path.getParent();
8383
if (parentPath != null) {
@@ -92,15 +92,17 @@ private void commonWrite(String fullPath, byte[] pResourceData, boolean createFo
9292

9393
private byte[] commonRead(String fullPath) {
9494
try {
95-
return Files.readAllBytes(Paths.get(fullPath).normalize());
95+
final Path path = PathUtils.getSecuredPath(root.toPath(), fullPath);
96+
return Files.readAllBytes(path);
9697
} catch (IOException e) {
9798
throw new RuntimeException(e);
9899
}
99100
}
100101

101102
private void commonRemove(String fullPath) {
102103
try {
103-
Files.deleteIfExists(Paths.get(fullPath).normalize());
104+
final Path path = PathUtils.getSecuredPath(root.toPath(), fullPath);
105+
Files.deleteIfExists(path);
104106
} catch (IOException e) {
105107
throw new RuntimeException(e);
106108
}

0 commit comments

Comments
 (0)