SlstrPduStitcher { static String createParentDirectoryNameOfStitchedFile(SlstrNameDecomposition[] slstrNameDecompositions, Date now) { Date startTime = extractStartTime(slstrNameDecompositions); Date stopTime = extractStopTime(slstrNameDecompositions); final StringBuilder slstrNameStringBuilder = new StringBuilder("S3A_SL_1_RBT___"); String[] slstrNameParts = new String[]{SLSTR_DATE_FORMAT_CONVERTER.format(startTime), SLSTR_DATE_FORMAT_CONVERTER.format(stopTime), SLSTR_DATE_FORMAT_CONVERTER.format(now), slstrNameDecompositions[0].duration, slstrNameDecompositions[0].cycleNumber, slstrNameDecompositions[0].relativeOrbitNumber, slstrNameDecompositions[0].frameAlongTrackCoordinate, slstrNameDecompositions[0].fileGeneratingCentre, slstrNameDecompositions[0].platform, slstrNameDecompositions[0].timelinessOfProcessingWorkflow, slstrNameDecompositions[0].baselineCollectionOrDataUsage}; for (String namePart : slstrNameParts) { slstrNameStringBuilder.append("_").append(namePart); } slstrNameStringBuilder.append(".SEN3"); return slstrNameStringBuilder.toString(); }  static File createStitchedSlstrL1BFile(File targetDirectory, File[] slstrProductFiles, String productName,
                                                  ProgressMonitor pm);  }
@Test public void testCreateParentDirectoryNameOfStitchedFile() throws URISyntaxException, PDUStitchingException { SlstrPduStitcher.SlstrNameDecomposition[] decompositions = new SlstrPduStitcher.SlstrNameDecomposition[3]; decompositions[0] = SlstrPduStitcher.decomposeSlstrName(TestUtils.getFirstSlstrFile().getParentFile().getName()); decompositions[1] = SlstrPduStitcher.decomposeSlstrName(TestUtils.getSecondSlstrFile().getParentFile().getName()); decompositions[2] = SlstrPduStitcher.decomposeSlstrName(TestUtils.getThirdSlstrFile().getParentFile().getName()); Date time = Calendar.getInstance().getTime(); final String parentDirectoryNameOfStitchedFile = SlstrPduStitcher.createParentDirectoryNameOfStitchedFile(decompositions, time); final String now = new SimpleDateFormat("yyyyMMdd'T'HHmmss").format(time); assertEquals("S3A_SL_1_RBT____20130707T153252_20130707T154752_" + now + "_0299_158_182______SVL_O_NR_001.SEN3", parentDirectoryNameOfStitchedFile); }