• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ZipAbortException类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException的典型用法代码示例。如果您正苦于以下问题:Java ZipAbortException类的具体用法?Java ZipAbortException怎么用?Java ZipAbortException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ZipAbortException类属于com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter包,在下文中一共展示了ZipAbortException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: writeZip

点赞 2

import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; //导入依赖的package包/类
/**
 * Copies the content of a Jar/Zip archive into the receiver archive.
 * <p/>An optional {@link IZipEntryFilter} allows to selectively choose which files
 * to copy over.
 * @param input the {@link InputStream} for the Jar/Zip to copy.
 * @param filter the filter or <code>null</code>
 * @throws IOException
 * @throws ZipAbortException if the {@link IZipEntryFilter} filter indicated that the write
 *                           must be aborted.
 */
public void writeZip(InputStream input, IZipEntryFilter filter)
        throws IOException, ZipAbortException {
    ZipInputStream zis = new ZipInputStream(input);

    try {
        // loop on the entries of the intermediary package and put them in the final package.
        ZipEntry entry;
        while ((entry = zis.getNextEntry()) != null) {
            String name = entry.getName();

            // do not take directories or anything inside a potential META-INF folder.
            if (entry.isDirectory() || name.startsWith("META-INF/")) {
                continue;
            }

            // if we have a filter, we check the entry against it
            if (filter != null && filter.checkEntry(name) == false) {
                continue;
            }

            JarEntry newEntry;

            // Preserve the STORED method of the input entry.
            if (entry.getMethod() == JarEntry.STORED) {
                newEntry = new JarEntry(entry);
            } else {
                // Create a new entry so that the compressed len is recomputed.
                newEntry = new JarEntry(name);
            }

            writeEntry(zis, newEntry);

            zis.closeEntry();
        }
    } finally {
        zis.close();
    }
}
 

开发者ID:theaetetus,
项目名称:AndroidApkMaker,
代码行数:49,
代码来源:SignedJarBuilder.java

示例2: writeZip

点赞 2

import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; //导入依赖的package包/类
/**
 * Copies the content of a Jar/Zip archive into the receiver archive.
 * <p/>An optional {@link IZipEntryFilter} allows to selectively choose which files
 * to copy over.
 * @param input the {@link InputStream} for the Jar/Zip to copy.
 * @param filter the filter or <code>null</code>
 * @throws IOException
 * @throws ZipAbortException if the {@link IZipEntryFilter} filter indicated that the write
 *                           must be aborted.
 */
public void writeZip(InputStream input, IZipEntryFilter filter)
        throws IOException, ZipAbortException {
    ZipInputStream zis = new ZipInputStream(input);

    try {
        // loop on the entries of the intermediary package and put them in the final package.
        ZipEntry entry;
        while ((entry = zis.getNextEntry()) != null) {
            String name = entry.getName();

            // do not take directories
            if (entry.isDirectory()) {
                continue;
            }
            // if we have a filter, we check the entry against it
            if (filter != null && !filter.checkEntry(name)) {
                continue;
            }

            JarEntry newEntry;

            // Preserve the STORED method of the input entry.
            if (entry.getMethod() == JarEntry.STORED) {
                newEntry = new JarEntry(entry);
            } else {
                // Create a new entry so that the compressed len is recomputed.
                newEntry = new JarEntry(name);
            }

            writeEntry(zis, newEntry);

            zis.closeEntry();
        }
    } finally {
        zis.close();
    }
}
 

开发者ID:bazelbuild,
项目名称:bazel,
代码行数:48,
代码来源:SignedJarBuilder.java

示例3: writeZip

点赞 2

import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; //导入依赖的package包/类
/**
 * Copies the content of a Jar/Zip archive into the receiver archive.
 * <p>An optional {@link IZipEntryFilter} allows to selectively choose which files
 * to copy over.
 * @param input the {@link InputStream} for the Jar/Zip to copy.
 * @param filter the filter or <code>null</code>
 * @throws IOException
 * @throws ZipAbortException if the {@link IZipEntryFilter} filter indicated that the write
 *                           must be aborted.
 */
public void writeZip(InputStream input, IZipEntryFilter filter)
    throws IOException, ZipAbortException {
  ZipInputStream zis = new ZipInputStream(input);

  try {
    // loop on the entries of the intermediary package and put them in the final package.
    ZipEntry entry;
    while ((entry = zis.getNextEntry()) != null) {
      String name = entry.getName();

      // do not take directories or anything inside a potential META-INF folder.
      if (entry.isDirectory() || name.startsWith("META-INF/")) {
        continue;
      }

      // if we have a filter, we check the entry against it
      if (filter != null && filter.checkEntry(name) == false) {
        continue;
      }

      JarEntry newEntry;

      // Preserve the STORED method of the input entry.
      if (entry.getMethod() == JarEntry.STORED) {
        newEntry = new JarEntry(entry);
      } else {
        // Create a new entry so that the compressed len is recomputed.
        newEntry = new JarEntry(name);
      }

      writeEntry(zis, newEntry);

      zis.closeEntry();
    }
  } finally {
    zis.close();
  }
}
 

开发者ID:facebook,
项目名称:buck,
代码行数:49,
代码来源:SignedJarBuilder.java

示例4: ZipAbortException

点赞 2

import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; //导入依赖的package包/类
public ZipAbortException() {
    super();
}
 

开发者ID:tranleduy2000,
项目名称:javaide,
代码行数:4,
代码来源:SignedJarBuilder.java

示例5: checkEntry

点赞 1

import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; //导入依赖的package包/类
/**
 * Checks a file for inclusion in a Jar archive.
 * @param archivePath the archive file path of the entry
 * @return <code>true</code> if the file should be included.
 * @throws ZipAbortException if writing the file should be aborted.
 */
public boolean checkEntry(String archivePath) throws ZipAbortException;
 

开发者ID:tranleduy2000,
项目名称:javaide,
代码行数:8,
代码来源:SignedJarBuilder.java

示例6: checkEntry

点赞 1

import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; //导入依赖的package包/类
/**
 * Checks a file for inclusion in a Jar archive.
 * @param archivePath the archive file path of the entry
 * @return <code>true</code> if the file should be included.
 * @throws ZipAbortException if writing the file should be aborted.
 */
boolean checkEntry(String archivePath) throws ZipAbortException;
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:8,
代码来源:SignedJarBuilder.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)