package com.se.simu.domain.dto; import cn.hutool.core.io.FileUtil; import com.se.simu.helper.GdalHelper; import org.gdal.osr.SpatialReference; import java.io.File; import java.util.*; @SuppressWarnings("ALL") public class ResultDto { private String serviceName; private String terrainFile; private String buildingFile; private String waterPath; private String flowPath; private String outPath; private String temp; private int epsg; private SpatialReference spatialReference; private Map buildings; private List buildingList; public ResultDto() { this.buildings = new HashMap<>(); this.buildingList = new ArrayList<>(); } public ResultDto(String serviceName, String terrainFile, String buildingFile, String waterPath, String flowPath, String outPath, int epsg) { this(); this.serviceName = serviceName; this.terrainFile = terrainFile; this.buildingFile = buildingFile; this.waterPath = waterPath; this.flowPath = flowPath; this.outPath = outPath + File.separator + serviceName; this.temp = outPath + File.separator + serviceName + File.separator + "temp"; this.epsg = epsg; this.spatialReference = GdalHelper.createSpatialReference(epsg); File dir = new File(this.outPath); if (dir.exists() && dir.isDirectory()) { FileUtil.del(dir); } dir.mkdirs(); dir = new File(this.temp); if (dir.exists() && dir.isDirectory()) { FileUtil.del(dir); } dir.mkdirs(); } public String getServiceName() { return serviceName; } public void setServiceName(String serviceName) { this.serviceName = serviceName; } public String getTerrainFile() { return terrainFile; } public void setTerrainFile(String terrainFile) { this.terrainFile = terrainFile; } public String getBuildingFile() { return buildingFile; } public void setBuildingFile(String buildingFile) { this.buildingFile = buildingFile; } public String getWaterPath() { return waterPath; } public void setWaterPath(String waterPath) { this.waterPath = waterPath; } public String getFlowPath() { return flowPath; } public void setFlowPath(String flowPath) { this.flowPath = flowPath; } public String getOutPath() { return outPath; } public void setOutPath(String outPath) { this.outPath = outPath; } public String getTemp() { return temp; } public void setTemp(String temp) { this.temp = temp; } public Map getBuildings() { return buildings; } public void setBuildings(Map buildings) { this.buildings = buildings; } public List getBuildingList() { return buildingList; } public void setBuildingList(List buildingList) { this.buildingList = buildingList; } public int getEpsg() { return epsg; } public void setEpsg(int epsg) { this.epsg = epsg; } public SpatialReference getSpatialReference() { return spatialReference; } public void setSpatialReference(SpatialReference spatialReference) { this.spatialReference = spatialReference; } }