Skip to content

Commit

Permalink
Upgrade lastnpe EEA to 2.4.0 (#2813)
Browse files Browse the repository at this point in the history
For release notes, see:

https://github.com/lastnpe/eclipse-null-eea-augments/releases/tag/v2.4.0

Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn authored Oct 20, 2024
1 parent 5bc928d commit f5f3a3e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.io.StringWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Objects;

import javax.servlet.http.HttpServletRequest;
import javax.xml.XMLConstants;
Expand Down Expand Up @@ -117,7 +118,7 @@ public String getConfigXml(HttpServletRequest req) {

// set relative path to XSD file
File rootFolder = new File(Config.cometvisuWebfolder);
File file = new File(rootFolder, req.getPathInfo());
File file = new File(rootFolder, Objects.requireNonNull(req.getPathInfo(), "Path info should not be null"));
String relXsd = "";
File parent = file.getParentFile();
File schema = new File(parent, "visu_config.xsd");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ private void extractFolder(String folderName, ZipFile zipFile, String destDir) {
// never ever overwrite existing config files
continue;
}
new File(file.getParent()).mkdirs();
String parent = file.getParent();
if (parent != null) {
new File(parent).mkdirs();
}

try (InputStream is = zipFile.getInputStream(entry); OutputStream os = new FileOutputStream(file)) {
for (int len; (len = is.read(BUFFER)) != -1;) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,12 @@ public boolean isInTrash(File file) {
}

public void saveFile(File file, InputStream fileInputStream, String hash) throws FileOperationException {
File parentDir = new File(file.getParent());
if (!parentDir.exists()) {
parentDir.mkdirs();
String parent = file.getParent();
if (parent != null) {
File parentDir = new File(parent);
if (!parentDir.exists()) {
parentDir.mkdirs();
}
}
// check hash
try {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<maven.compiler.release>${oh.java.version}</maven.compiler.release>

<bnd.version>7.0.0</bnd.version>
<eea.version>2.3.0</eea.version>
<eea.version>2.4.0</eea.version>
<jackson.version>2.16.0</jackson.version>
<karaf.version>4.4.6</karaf.version>
<ohc.version>4.3.0-SNAPSHOT</ohc.version>
Expand Down

0 comments on commit f5f3a3e

Please sign in to comment.