集册 Java实例教程 确定邮政编码条目是否为目录

确定邮政编码条目是否为目录

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

504
确定邮政编码条目是否为目录

 
 /**
  from
 * nowjava.com - 时代Java 
 **/

import java.io.IOException;

import java.util.Enumeration;

import java.util.zip.ZipEntry;

import java.util.zip.ZipFile;


public class Main {


  public static void main(String args[]) {

    try {

      ZipFile zipFile = new ZipFile("c:/Folder/Files.zip");

      Enumeration e = zipFile.entries();


      System.out.print("File Name");

      System.out.print("\t\t\t\tIs Directory");


      while (e.hasMoreElements()) {

        ZipEntry entry = (ZipEntry) e.nextElement();/* 来自 N o w J a v a . c o m - 时代Java*/


        String entryName = entry.getName();

        boolean isDir = entry.isDirectory();


        System.out.print(entryName);

        System.out.print("\t\t\t\t" + isDir);

        System.out.print(
展开阅读全文