org.zeroturnaround.zip.ZipUtil.removeEntry()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(107)

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

ZipUtil.removeEntry介绍

[英]Changes an existing ZIP file: removes entry with a given path.
[中]更改现有ZIP文件:删除具有给定路径的条目。

代码示例

代码示例来源:origin: zeroturnaround/zt-zip

  1. public boolean act(File tmpFile) {
  2. removeEntry(zip, path, tmpFile);
  3. return true;
  4. }
  5. });

代码示例来源:origin: jphp-group/jphp

  1. @Signature
  2. public void remove(Environment env, Memory path) {
  3. if (path.isTraversable()) {
  4. ForeachIterator iterator = path.getNewIterator(env);
  5. List<String> paths = new ArrayList<>();
  6. while (iterator.next()) {
  7. String value = iterator.getValue().toString();
  8. paths.add(value);
  9. }
  10. ZipUtil.removeEntries(zipFile, paths.toArray(new String[paths.size()]));
  11. } else {
  12. ZipUtil.removeEntry(zipFile, path.toString());
  13. }
  14. }

代码示例来源:origin: org.zeroturnaround/zt-zip

  1. public boolean act(File tmpFile) {
  2. removeEntry(zip, path, tmpFile);
  3. return true;
  4. }
  5. });

代码示例来源:origin: org.hswebframework/hsweb-expands-compress

  1. public void remove(String entryName) throws IOException {
  2. ZipUtil.removeEntry(zipFile, entryName);
  3. }

代码示例来源:origin: hs-web/hsweb-expands

  1. public void remove(String entryName) throws IOException {
  2. ZipUtil.removeEntry(zipFile, entryName);
  3. }

代码示例来源:origin: com.microsoft.azure/azure-maven-plugin-lib

  1. protected File getZipFile() {
  2. final File zipFile = new File(stagingDirectoryPath + ".zip");
  3. final File stagingDirectory = new File(stagingDirectoryPath);
  4. ZipUtil.pack(stagingDirectory, zipFile);
  5. ZipUtil.removeEntry(zipFile, LOCAL_SETTINGS_FILE);
  6. return zipFile;
  7. }
  8. }

代码示例来源:origin: Microsoft/azure-maven-plugins

  1. protected File getZipFile() {
  2. final File zipFile = new File(stagingDirectoryPath + ".zip");
  3. final File stagingDirectory = new File(stagingDirectoryPath);
  4. ZipUtil.pack(stagingDirectory, zipFile);
  5. ZipUtil.removeEntry(zipFile, LOCAL_SETTINGS_FILE);
  6. return zipFile;
  7. }
  8. }

代码示例来源:origin: Microsoft/azure-maven-plugins

  1. protected File createZipPackage() throws Exception {
  2. logInfo("");
  3. logInfo(CREATE_ZIP_START);
  4. final File stageDirectory = new File(stagingDirectoryPath);
  5. final File zipPackage = new File(stagingDirectoryPath.concat(ZIP_EXT));
  6. if (!stageDirectory.exists()) {
  7. logError(STAGE_DIR_NOT_FOUND);
  8. throw new Exception(STAGE_DIR_NOT_FOUND);
  9. }
  10. ZipUtil.pack(stageDirectory, zipPackage);
  11. logDebug(REMOVE_LOCAL_SETTINGS);
  12. ZipUtil.removeEntry(zipPackage, LOCAL_SETTINGS_FILE);
  13. logInfo(CREATE_ZIP_DONE + stagingDirectoryPath.concat(ZIP_EXT));
  14. return zipPackage;
  15. }

相关文章