gpt4 book ai didi

org.esa.snap.engine_utilities.util.ZipUtils.isZip()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 13:13:31 24 4
gpt4 key购买 nike

本文整理了Java中org.esa.snap.engine_utilities.util.ZipUtils.isZip()方法的一些代码示例,展示了ZipUtils.isZip()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipUtils.isZip()方法的具体详情如下:
包路径:org.esa.snap.engine_utilities.util.ZipUtils
类名称:ZipUtils
方法名:isZip

ZipUtils.isZip介绍

暂无

代码示例

代码示例来源:origin: senbox-org/s1tbx

protected String getHeaderFileName() {
  if (ZipUtils.isZip(headerFile)) {
    return ""; //todo
  } else {
    return headerFile.getName();
  }
}

代码示例来源:origin: senbox-org/s1tbx

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");
    }
  }
}

代码示例来源:origin: senbox-org/s1tbx

protected String getHeaderFileName() {
  if (ZipUtils.isZip(productInputFile)) {
    try {
      String[] files = listFiles("");
      for (String file : files) {
        if (file.startsWith("SS_") && file.endsWith(".xml") && !file.endsWith(".iso.xml")) {
          return file;
        }
      }
    } catch (Exception e) {
    }
  }
  return productInputFile.getName();
}

代码示例来源:origin: senbox-org/s1tbx

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");
  }
}

代码示例来源:origin: senbox-org/s1tbx

protected void createProductDir(final File inputFile) {
  if (ZipUtils.isZip(inputFile)) {
    baseDir = inputFile;
    productDir = VirtualDir.create(baseDir);
    baseName = baseDir.getName();
    if(baseName.endsWith(".zip")) {
      baseName = baseName.substring(0, baseName.lastIndexOf(".zip"));
    }
  } else {
    baseDir = inputFile.getParentFile();
    productDir = VirtualDir.create(baseDir);
    baseName = baseDir.getName();
  }
}

代码示例来源:origin: senbox-org/s1tbx

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");
  }
}

代码示例来源:origin: senbox-org/s1tbx

protected VirtualDir createProductDir(final File inputFile) {
  if (ZipUtils.isZip(inputFile)) {
    return VirtualDir.create(inputFile);
  } else {
    return VirtualDir.create(inputFile.getParentFile());
  }
}

代码示例来源:origin: senbox-org/s1tbx

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");
  }
}

代码示例来源:origin: senbox-org/s1tbx

private synchronized Raster getData(final ImageReadParam param,
                  final int destOffsetX, final int destOffsetY,
                  final int destWidth, final int destHeight) throws IOException {
  try {
    final RenderedImage image = reader.readAsRenderedImage(0, param);
    return image.getData(new Rectangle(destOffsetX, destOffsetY, destWidth, destHeight));
  } catch (Exception e) {
    if(ZipUtils.isZip(productInputFile) && !ZipUtils.isValid(productInputFile)) {
      throw new IOException("Zip file is corrupt "+productInputFile.getName());
    }
    throw e;
  }
}

代码示例来源:origin: senbox-org/s1tbx

/**
 * 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) {
    if (file.getName().startsWith(PRODUCT_PREFIX) && ZipUtils.isZip(file)) {
      return DecodeQualification.INTENDED;
    }
    if (findMetadataFile(file) != null) {
      return DecodeQualification.INTENDED;
    }
  }
  return DecodeQualification.UNABLE;
}

代码示例来源:origin: senbox-org/snap-desktop

if (ZipUtils.isZip(file) && !ZipUtils.isValid(file)) {
  errorList.add(new ErrorFile(file, ErrorFile.CORRUPT_ZIP));
  continue;

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com