static void validateInput(final File file) throws IOException { if (ZipUtils.isZip(file)) { if(!ZipUtils.findInZip(file, "s1", ".tiff")) { throw new IOException("measurement folder is missing in product"); } } else { final File baseFolder = file.getParentFile(); final File annotationFolder = new File(baseFolder, ANNOTATION); if (!annotationFolder.exists()) { throw new IOException("annotation folder is missing in product"); } } }
static boolean isLevel1(final File file) { if (ZipUtils.isZip(file)) { if(ZipUtils.findInZip(file, "s1", ".tiff")) { return true; } final String name = file.getName().toUpperCase(); return name.contains("_1AS") || name.contains("_1AD") || name.contains("_1SS") || name.contains("_1SD"); } else { final File baseFolder = file.getParentFile(); final File annotationFolder = new File(baseFolder, ANNOTATION); return annotationFolder.exists() && checkFolder(annotationFolder, ".xml"); } }
static boolean isLevel2(final File file) { if (ZipUtils.isZip(file)) { return ZipUtils.findInZip(file, "s1", ".nc"); } else { final File baseFolder = file.getParentFile(); final File measurementFolder = new File(baseFolder, MEASUREMENT); return measurementFolder.exists() && checkFolder(measurementFolder, ".nc"); } }
static boolean isLevel0(final File file) { if (ZipUtils.isZip(file)) { return ZipUtils.findInZip(file, "s1", ".dat"); } else { final File baseFolder = file.getParentFile(); return checkFolder(baseFolder, ".dat"); } }
@Override protected DecodeQualification checkProductQualification(File file) { final String name = file.getName().toUpperCase(); if(name.contains("ALOS2")) { for (String prefix : constants.getVolumeFilePrefix()) { if (name.startsWith(prefix)) { final Alos2ProductReader reader = new Alos2ProductReader(this); return reader.checkProductQualification(file); } } } if (name.endsWith(".ZIP") && (ZipUtils.findInZip(file, "vol-alos2", ""))) { return DecodeQualification.INTENDED; } return DecodeQualification.UNABLE; }
/** * Checks whether the given object is an acceptable input for this product reader and if so, the method checks if it * is capable of decoding the input's content. * * @param input any input object * @return true if this product reader can decode the given input, otherwise false. */ public DecodeQualification getDecodeQualification(final Object input) { final File file = ReaderUtils.getFileFromInput(input); if (file != null) { final File metadataFile = findMetadataFile(file); if (metadataFile != null) { return DecodeQualification.INTENDED; } final String filename = file.getName().toLowerCase(); if (filename.endsWith(".zip") && ZipUtils.findInZip(file, "", Risat1Constants.BAND_HEADER_NAME)) { return DecodeQualification.INTENDED; } } //todo zip stream return DecodeQualification.UNABLE; }
ZipUtils.findInZip(file, "", Radarsat2Constants.PRODUCT_HEADER_NAME)) { return DecodeQualification.INTENDED;
/** * Checks whether the given object is an acceptable input for this product reader and if so, the method checks if it * is capable of decoding the input's content. * * @param input any input object * @return true if this product reader can decode the given input, otherwise false. */ public DecodeQualification getDecodeQualification(final Object input) { final File file = ReaderUtils.getFileFromInput(input); if (file != null) { final String filename = file.getName().toUpperCase(); if (filename.startsWith(SeaSatConstants.PRODUCT_HEADER_PREFIX)) { if (filename.endsWith(SeaSatConstants.getIndicationKey()) && !filename.endsWith(".ISO.XML")) { return DecodeQualification.INTENDED; } if (filename.endsWith(".ZIP") && ZipUtils.findInZip(file, SeaSatConstants.PRODUCT_HEADER_PREFIX, SeaSatConstants.getIndicationKey())) { return DecodeQualification.INTENDED; } } } //todo zip stream return DecodeQualification.UNABLE; }