DrbImageManager { String getMGRSFromName (String name) { String mgrs = null; if (!name.matches("S2._.*")) mgrs = name.substring(1, 6); else mgrs = name.substring(50, 55); return mgrs; } DrbImageManager(); void add(DrbImage image); void addAll(Collection<DrbImage> images); Bands[][] getMosaic();  }
@Test public void getMgrs_Old() { String name_pvi="S2A_OPER_PVI_L1C_TL_EPA__20160704T162718_A000700_T52JFR.jp2"; String name="S2A_OPER_MSI_L1C_TL_EPA__20160704T162718_A000700_T52JFR_B01.jp2"; Assert.assertEquals(mgr.getMGRSFromName(name), "52JFR"); Assert.assertEquals(mgr.getMGRSFromName(name_pvi), "52JFR"); }
@Test public void getMgrs_Compact() { String name_pvi="T36JTT_20160914T074612_PVI.jp2"; String name="T36JTT_20160914T074612_B01.jp2"; Assert.assertEquals(mgr.getMGRSFromName(name), "36JTT"); Assert.assertEquals(mgr.getMGRSFromName(name_pvi), "36JTT"); }