集册 Java实例教程 列出邮编

列出邮编

欢马劈雪     最近更新时间:2020-01-02 10:19:05

473
列出邮编

/*

 * CODENVY CONFIDENTIAL

 * __________________

 *

 *  [2012] - [2013] Codenvy, S.A.

 *  All Rights Reserved.

 *

 * NOTICE:  All information contained herein is, and remains

 * the property of Codenvy S.A. and its suppliers,

 * if any.  The intellectual and technical concepts contained

 * herein are proprietary to Codenvy S.A.

 * and its suppliers and may be covered by U.S. and Foreign Patents,

 * patents in process, and are protected by trade secret or copyright law.

 * Dissemination of this information or reproduction of this material

 * is strictly forbidden unless prior written permission is obtained

 * from Codenvy S.A..

 *///from NowJava.com

//package com.nowjava;

import java.io.File;

import java.io.FileInputStream;


import java.io.IOException;

import java.io.InputStream;


import java.util.ArrayList;

import java.util.Collection;


import java.util.List;


import java.util.zip.ZipEntry;

import java.util.zip.ZipInputStream;


public class Main {

    public static Collection<String> listEntries(File zip)

            throws IOException {
            /**
             from
            * N o w J a v a . c o m - 时代Java 
            **/

        return listEntries(new FileInputStream(zip));

    }


    public static Collection<String> listEntries(InputStream in)

            throws IOException {

        List<String> list = new ArrayList<String>();

        ZipInputStream zipIn = null;

        try {

            zipIn = new ZipInputStream(in);

            ZipEntry zipEntry;

            while ((zipEntry = zipIn.getNextEntry()) != null) {

     
展开阅读全文