SpotVgtProductReaderPlugIn implements ProductReaderPlugIn { static String getBandName(String name) { int p1 = name.indexOf("_"); int p2 = name.lastIndexOf('.'); return name.substring(p1 == -1 ? 0 : p1 + 1, p2); } SpotVgtProductReaderPlugIn(); @Override DecodeQualification getDecodeQualification(Object input); @Override Class[] getInputTypes(); @Override ProductReader createReaderInstance(); @Override SnapFileFilter getProductFileFilter(); @Override String[] getDefaultFileExtensions(); @Override String getDescription(Locale locale); @Override String[] getFormatNames();  }
@Test public void testGetBandName() { assertEquals("VZA", SpotVgtProductReaderPlugIn.getBandName("VZA.HDF")); assertEquals("VZA", SpotVgtProductReaderPlugIn.getBandName("_VZA.HDF")); assertEquals("B2", SpotVgtProductReaderPlugIn.getBandName("V220050513179_B2.HDF")); assertEquals("MIR", SpotVgtProductReaderPlugIn.getBandName("V220050513179_MIR.HDF")); }