@Test public void testCreateMap_sourceDirectory() { final File expectedSourceDir = new File("/home/tom"); exportParameter.setSourceDirectory(expectedSourceDir); final HashMap<String, Object> parameterMap = ConverterSwingWorker.createParameterMap(exportParameter); final String sourceDirectory = (String) parameterMap.get("sourceProductPaths"); final String absolutePath = expectedSourceDir.getAbsolutePath(); assertEquals(absolutePath + File.separator + "*.zip," + absolutePath + File.separator + "*.dbl", sourceDirectory); }
static HashMap<String, Object> createParameterMap(ExportParameter exportParameter) { final HashMap<String, Object> parameterMap = new HashMap<>(); final File targetDirectory = exportParameter.getTargetDirectory(); if (targetDirectory != null) { parameterMap.put("targetDirectory", targetDirectory); } final File sourceDirectory = exportParameter.getSourceDirectory(); if (sourceDirectory != null && !exportParameter.isUseSelectedProduct()) { final String sourcePath = createInputPathWildcards(sourceDirectory); parameterMap.put("sourceProductPaths", sourcePath); } final int roiType = exportParameter.getRoiType(); if (roiType == BindingConstants.ROI_TYPE_AREA) { parameterMap.put("region", exportParameter.toAreaWKT()); } else if (roiType == BindingConstants.ROI_TYPE_GEOMETRY) { addSelectedProductGeometry(exportParameter.getRegion(), parameterMap); } else if (roiType == BindingConstants.ROI_TYPE_PRODUCT) { parameterMap.remove("region"); } if (exportParameter.isOverwriteTarget()) { parameterMap.put("overwriteTarget", "true"); } else { parameterMap.put("overwriteTarget", "false"); } return parameterMap; }
ConverterSwingWorker extends ProgressMonitorSwingWorker<List<Exception>, File> { static HashMap<String, Object> createParameterMap(ExportParameter exportParameter) { final HashMap<String, Object> parameterMap = new HashMap<>(); final File targetDirectory = exportParameter.getTargetDirectory(); if (targetDirectory != null) { parameterMap.put("targetDirectory", targetDirectory); } final File sourceDirectory = exportParameter.getSourceDirectory(); if (sourceDirectory != null && !exportParameter.isUseSelectedProduct()) { final String sourcePath = createInputPathWildcards(sourceDirectory); parameterMap.put("sourceProductPaths", sourcePath); } final int roiType = exportParameter.getRoiType(); if (roiType == BindingConstants.ROI_TYPE_AREA) { parameterMap.put("region", exportParameter.toAreaWKT()); } else if (roiType == BindingConstants.ROI_TYPE_GEOMETRY) { addSelectedProductGeometry(exportParameter.getRegion(), parameterMap); } else if (roiType == BindingConstants.ROI_TYPE_PRODUCT) { parameterMap.remove("region"); } if (exportParameter.isOverwriteTarget()) { parameterMap.put("overwriteTarget", "true"); } else { parameterMap.put("overwriteTarget", "false"); } return parameterMap; } }
ConverterSwingWorker extends ProgressMonitorSwingWorker<List<Exception>, File> { static HashMap<String, Object> createParameterMap(ExportParameter exportParameter) { final HashMap<String, Object> parameterMap = new HashMap<>(); final File targetDirectory = exportParameter.getTargetDirectory(); if (targetDirectory != null) { parameterMap.put("targetDirectory", targetDirectory); } final File sourceDirectory = exportParameter.getSourceDirectory(); if (sourceDirectory != null && !exportParameter.isUseSelectedProduct()) { final String sourcePath = createInputPathWildcards(sourceDirectory); parameterMap.put("sourceProductPaths", sourcePath); } final int roiType = exportParameter.getRoiType(); if (roiType == BindingConstants.ROI_TYPE_AREA) { parameterMap.put("region", exportParameter.toAreaWKT()); } else if (roiType == BindingConstants.ROI_TYPE_GEOMETRY) { addSelectedProductGeometry(exportParameter.getRegion(), parameterMap); } else if (roiType == BindingConstants.ROI_TYPE_PRODUCT) { parameterMap.remove("region"); } if (exportParameter.isOverwriteTarget()) { parameterMap.put("overwriteTarget", "true"); } else { parameterMap.put("overwriteTarget", "false"); } return parameterMap; } ConverterSwingWorker(AppContext appContext, ExportParameter exportParameter); }
ConverterSwingWorker extends ProgressMonitorSwingWorker<List<Exception>, File> { static HashMap<String, Object> createParameterMap(ExportParameter exportParameter) { final HashMap<String, Object> parameterMap = new HashMap<>(); final File targetDirectory = exportParameter.getTargetDirectory(); if (targetDirectory != null) { parameterMap.put("targetDirectory", targetDirectory); } final File sourceDirectory = exportParameter.getSourceDirectory(); if (sourceDirectory != null && !exportParameter.isUseSelectedProduct()) { final String sourcePath = createInputPathWildcards(sourceDirectory); parameterMap.put("sourceProductPaths", sourcePath); } final int roiType = exportParameter.getRoiType(); if (roiType == BindingConstants.ROI_TYPE_AREA) { parameterMap.put("region", exportParameter.toAreaWKT()); } else if (roiType == BindingConstants.ROI_TYPE_GEOMETRY) { addSelectedProductGeometry(exportParameter.getRegion(), parameterMap); } else if (roiType == BindingConstants.ROI_TYPE_PRODUCT) { parameterMap.remove("region"); } if (exportParameter.isOverwriteTarget()) { parameterMap.put("overwriteTarget", "true"); } else { parameterMap.put("overwriteTarget", "false"); } return parameterMap; } ConverterSwingWorker(AppContext appContext, ExportParameter exportParameter);  }
ConverterSwingWorker extends ProgressMonitorSwingWorker<List<Exception>, File> { static HashMap<String, Object> createParameterMap(ExportParameter exportParameter) { final HashMap<String, Object> parameterMap = new HashMap<>(); final File targetDirectory = exportParameter.getTargetDirectory(); if (targetDirectory != null) { parameterMap.put("targetDirectory", targetDirectory); } final File sourceDirectory = exportParameter.getSourceDirectory(); if (sourceDirectory != null && !exportParameter.isUseSelectedProduct()) { final String sourcePath = createInputPathWildcards(sourceDirectory); parameterMap.put("sourceProductPaths", sourcePath); } final int roiType = exportParameter.getRoiType(); if (roiType == BindingConstants.ROI_TYPE_AREA) { parameterMap.put("region", exportParameter.toAreaWKT()); } else if (roiType == BindingConstants.ROI_TYPE_GEOMETRY) { addSelectedProductGeometry(exportParameter.getRegion(), parameterMap); } else if (roiType == BindingConstants.ROI_TYPE_PRODUCT) { parameterMap.remove("region"); } if (exportParameter.isOverwriteTarget()) { parameterMap.put("overwriteTarget", "true"); } else { parameterMap.put("overwriteTarget", "false"); } return parameterMap; } ConverterSwingWorker(AppContext appContext, ExportParameter exportParameter);   }