fixed filenames with domain separator

This commit is contained in:
rdavidek 2026-03-10 10:23:05 +01:00
parent 27e1a13b7c
commit ce85cc22ee

View File

@ -109,8 +109,8 @@ public class ExportAppsToWso2FromV32 extends AbstractProcess {
byte[] data = prepareAppZipFile32to45(yamlApp);
String fileName = yamlApp.getData().getApplicationInfo().getName() + "-"
+ yamlApp.getData().getApplicationInfo().getOwner() + "-v45.zip";
String fileName = (yamlApp.getData().getApplicationInfo().getName() + "-"
+ yamlApp.getData().getApplicationInfo().getOwner() + "-v45.zip").replace('\\', '_').replace('/', '_');
if (config.isStoreMigratedArtifacts()) {
File tmpFile = new File("tmp/app/", fileName);
@ -138,8 +138,8 @@ public class ExportAppsToWso2FromV32 extends AbstractProcess {
}
public byte[] prepareAppZipFile32to45(ApplicationDetail45 yamlApp) throws Exception {
String baseDir = yamlApp.getData().getApplicationInfo().getOwner() + "-"
+ yamlApp.getData().getApplicationInfo().getName() + "/";
String baseDir = (yamlApp.getData().getApplicationInfo().getOwner() + "-"
+ yamlApp.getData().getApplicationInfo().getName()).replace('\\', '_').replace('/', '_') + "/";
try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos)) {