Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade lastnpe EEA to 2.4.0 #2813

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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