@Test public void testGetSatelliteByProductName() throws Exception { final String productName = "S2A_OPER_PRD_MSIL1C_PDMC_20130621T120000_R065_V20091211T165928_20091211T170025.SAFE"; final String expected = "S2A"; final String satellite = Sentinel2Utils.getSatelliteByProductName(productName); Assert.assertEquals(expected, satellite); }
public static String getSatelliteByProductName(final String productName) { final String PATTERN = "S2[AB]"; String result = ""; logger.debug("(getSatelliteByProductName)(productName:" + productName + ")|start"); try { final Matcher matcher = Pattern.compile(PATTERN).matcher(productName); result = (matcher.find()) ? productName.substring(matcher.start(), matcher.end()) : ""; } catch (final Exception ex) { logger.warn("Sentinel-2 ingestion: Failed getting satellite name " + "by product."); } logger.debug("(getSatelliteByProductName) return:" + result + "|end"); return result; }
Sentinel2Utils { public static String getSatelliteByProductName(final String productName) { final String PATTERN = "S2[AB]"; String result = ""; logger.debug("(getSatelliteByProductName)(productName:" + productName + ")|start"); try { final Matcher matcher = Pattern.compile(PATTERN).matcher(productName); result = (matcher.find()) ? productName.substring(matcher.start(), matcher.end()) : ""; } catch (final Exception ex) { logger.warn("Sentinel-2 ingestion: Failed getting satellite name " + "by product."); } logger.debug("(getSatelliteByProductName) return:" + result + "|end"); return result; } }
Sentinel2Utils { public static String getSatelliteByProductName(final String productName) { final String PATTERN = "S2[AB]"; String result = ""; logger.debug("(getSatelliteByProductName)(productName:" + productName + ")|start"); try { final Matcher matcher = Pattern.compile(PATTERN).matcher(productName); result = (matcher.find()) ? productName.substring(matcher.start(), matcher.end()) : ""; } catch (final Exception ex) { logger.warn("Sentinel-2 ingestion: Failed getting satellite name " + "by product."); } logger.debug("(getSatelliteByProductName) return:" + result + "|end"); return result; } private  Sentinel2Utils(); }
Sentinel2Utils { public static String getSatelliteByProductName(final String productName) { final String PATTERN = "S2[AB]"; String result = ""; logger.debug("(getSatelliteByProductName)(productName:" + productName + ")|start"); try { final Matcher matcher = Pattern.compile(PATTERN).matcher(productName); result = (matcher.find()) ? productName.substring(matcher.start(), matcher.end()) : ""; } catch (final Exception ex) { logger.warn("Sentinel-2 ingestion: Failed getting satellite name " + "by product."); } logger.debug("(getSatelliteByProductName) return:" + result + "|end"); return result; } private  Sentinel2Utils(); static String xYZpoints2GML(final String pointsString); static String xYZpoints2JTS(final String pointsString); static String xYPoints2GML(final String pointsString); static String xYPoints2JTS(final String pointsString); static String getEndPositionByStart(final String startTime); static String getSatelliteByProductName(final String productName); static String filterUselessZeros(final String integer); static String getAbsoluteOrbitFromDatatakeFilename(
         final String datatakeFileName); static String getFormattedTimeString(final String rawTimeString); static String formatNumber(double value); }
Sentinel2Utils { public static String getSatelliteByProductName(final String productName) { final String PATTERN = "S2[AB]"; String result = ""; logger.debug("(getSatelliteByProductName)(productName:" + productName + ")|start"); try { final Matcher matcher = Pattern.compile(PATTERN).matcher(productName); result = (matcher.find()) ? productName.substring(matcher.start(), matcher.end()) : ""; } catch (final Exception ex) { logger.warn("Sentinel-2 ingestion: Failed getting satellite name " + "by product."); } logger.debug("(getSatelliteByProductName) return:" + result + "|end"); return result; } private  Sentinel2Utils(); static String xYZpoints2GML(final String pointsString); static String xYZpoints2JTS(final String pointsString); static String xYPoints2GML(final String pointsString); static String xYPoints2JTS(final String pointsString); static String getEndPositionByStart(final String startTime); static String getSatelliteByProductName(final String productName); static String filterUselessZeros(final String integer); static String getAbsoluteOrbitFromDatatakeFilename(
         final String datatakeFileName); static String getFormattedTimeString(final String rawTimeString); static String formatNumber(double value); static final String DATE_TIME_FORMAT; static final long SENSING_TIME; }