@Test public void testIsLandsat5LegacyFilename() throws Exception { assertTrue(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("LT51960300302003GSI01_MTL.txt")); assertTrue(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("LT51960300302003GSI01_MTL.TXT")); assertTrue(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("L5196030_03020031023_MTL.txt")); assertTrue(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("L5196030_03020031023_MTL.TXT")); assertTrue(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("LT51960302003296MTI01.tar.gz")); assertFalse(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("L51950302003257MTI01.tar.gz")); assertFalse(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("LT72160332013191LGN00.tar.gz")); assertFalse(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("LT82160332013191LGN00.tgz")); assertFalse(LandsatGeotiffReaderPlugin.isLandsat5LegacyFilename("LT82160332013191LGN00.dat")); }
static boolean isLandsat5LegacyFilename(String filename) { if (filename.matches("LT5\\d{13}.{3}\\d{2}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("L5\\d{6}_\\d{11}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("LT5\\d{13}.{3}\\d{2}\\.tar\\.gz")) { return true; } else { return false; } }
LandsatGeotiffReaderPlugin implements ProductReaderPlugIn { static boolean isLandsat5LegacyFilename(String filename) { if (filename.matches("LT5\\d{13}.{3}\\d{2}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("L5\\d{6}_\\d{11}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("LT5\\d{13}.{3}\\d{2}\\.tar\\.gz")) { return true; } else { return false; } } }
LandsatGeotiffReaderPlugin implements ProductReaderPlugIn { static boolean isLandsat5LegacyFilename(String filename) { if (filename.matches("LT5\\d{13}.{3}\\d{2}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("L5\\d{6}_\\d{11}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("LT5\\d{13}.{3}\\d{2}\\.tar\\.gz")) { return true; } else { return false; } }  }
LandsatGeotiffReaderPlugin implements ProductReaderPlugIn { static boolean isLandsat5LegacyFilename(String filename) { if (filename.matches("LT5\\d{13}.{3}\\d{2}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("L5\\d{6}_\\d{11}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("LT5\\d{13}.{3}\\d{2}\\.tar\\.gz")) { return true; } else { return false; } }  @Override DecodeQualification getDecodeQualification(Object input); @Override Class[] getInputTypes(); @Override ProductReader createReaderInstance(); @Override String[] getFormatNames(); @Override String[] getDefaultFileExtensions(); @Override String getDescription(Locale locale); @Override BeamFileFilter getProductFileFilter(); }
LandsatGeotiffReaderPlugin implements ProductReaderPlugIn { static boolean isLandsat5LegacyFilename(String filename) { if (filename.matches("LT5\\d{13}.{3}\\d{2}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("L5\\d{6}_\\d{11}_MTL.(txt|TXT)")) { return true; } else if (filename.matches("LT5\\d{13}.{3}\\d{2}\\.tar\\.gz")) { return true; } else { return false; } }  @Override DecodeQualification getDecodeQualification(Object input); @Override Class[] getInputTypes(); @Override ProductReader createReaderInstance(); @Override String[] getFormatNames(); @Override String[] getDefaultFileExtensions(); @Override String getDescription(Locale locale); @Override BeamFileFilter getProductFileFilter();  }