EnvisatAuxReader { public void readProduct(Object input) throws IOException { File file; if (input instanceof String) { file = getFile((String) input); } else if (input instanceof File) { file = (File) input; file = getFile(file.getAbsolutePath()); } else { throw new IllegalArgumentException("input"); } final ImageInputStream iis = getImageInputStream(file); final String productType = ProductFile.readProductType(iis); if (productType == null) { throw new IllegalFileFormatException("Not an ENVISAT product or ENVISAT product type not supported: " + file.toString()); } final String productTypeUC = productType.toUpperCase().substring(0, 9); if (productTypeUC.startsWith("AS")) { _productFile = new AsarXCAProductFile(file, iis); } else if (productTypeUC.startsWith("DOR")) { _productFile = new DorisOrbitProductFile(file, iis); } else { throw new IllegalFileFormatException("Not an ENVISAT product or ENVISAT product type not supported."); } } EnvisatAuxReader(); void readProduct(Object input); Date getSensingStart(); Date getSensingStop(); ProductData getAuxData(String name); void close(); static File getFile(String filePath);  }
@Test public void testAutoLookupZIP() throws IOException { EnvisatAuxReader reader = new EnvisatAuxReader(); reader.readProduct(envisatXCAZipFilePath2); testAuxDataFromGADS(reader); }
@Test public void testUncompressed() throws IOException { EnvisatAuxReader reader = new EnvisatAuxReader(); reader.readProduct(envisatXCAFilePath); testAuxDataFromGADS(reader); }
@Test public void testERS1() throws IOException { EnvisatAuxReader reader = new EnvisatAuxReader(); reader.readProduct(ers1XCAFilePath); }
@Test public void testERS2() throws IOException { EnvisatAuxReader reader = new EnvisatAuxReader(); reader.readProduct(ers2XCAFilePath); }
@Test public void testGZIP() throws IOException { EnvisatAuxReader reader = new EnvisatAuxReader(); reader.readProduct(envisatXCAGZFilePath); testAuxDataFromGADS(reader); }
@Test public void testZIP() throws IOException { EnvisatAuxReader reader = new EnvisatAuxReader(); reader.readProduct(envisatXCAZipFilePath); testAuxDataFromGADS(reader); }