Skip to content

Commit

Permalink
Fix case names when exported (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
achour94 authored and jonenst committed Sep 16, 2024
1 parent ce1679b commit 312155e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/powsybl/caseserver/CaseService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
import com.powsybl.caseserver.repository.CaseMetadataEntity;
import com.powsybl.caseserver.repository.CaseMetadataRepository;
import com.powsybl.commons.datasource.DataSource;
import com.powsybl.commons.datasource.DataSourceUtil;
import com.powsybl.commons.datasource.MemDataSource;
import com.powsybl.computation.ComputationManager;
import com.powsybl.computation.local.LocalComputationManager;
import com.powsybl.iidm.network.Exporter;
import com.powsybl.iidm.network.Importer;
import com.powsybl.iidm.network.Network;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -426,7 +426,7 @@ public Optional<ExportCaseInfos> exportCase(UUID caseUuid, String format, Map<St
network.write(format, exportProperties, memDataSource);

var listNames = memDataSource.listNames(".*");
String networkName = FilenameUtils.removeExtension(getCaseName(caseUuid));
String networkName = DataSourceUtil.getBaseName(getCaseName(caseUuid));
byte[] networkData;
if (listNames.size() == 1) {
String extension = listNames.iterator().next();
Expand Down

0 comments on commit 312155e

Please sign in to comment.