Java Jar Usage processJarFile(String f)

Here you can find the source of processJarFile(String f)

Description

process Jar File

License

Open Source License

Declaration

public static void processJarFile(String f) 

Method Source Code

//package com.java2s;
/*//from   w w w . java  2 s . c o  m
 * (C) 2007-2012 Alibaba Group Holding Limited.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * Authors:
 *   leiwen <chrisredfield1985@126.com> , boyan <killme2008@gmail.com>
 */

import java.util.Enumeration;

import java.util.jar.JarEntry;
import java.util.jar.JarFile;

public class Main {
    public static void processJarFile(String f) {
        try {
            JarFile jarF = new JarFile(f);
            Enumeration<JarEntry> je = jarF.entries();
            while (je.hasMoreElements()) {
                JarEntry entry = je.nextElement();
                String name = entry.getName();
                long size = entry.getSize();
                long compressedSize = entry.getCompressedSize();
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}

Related

  1. getSortedAttributes(Attributes mainAttributes)
  2. getSortedJarEntries(JarFile jarFile)
  3. isSet(Attributes attributes, String name)
  4. listFiles(JarFile jarFile, String path)
  5. process(Object obj)
  6. recordFactoryDefault(String className, Attributes attributes)
  7. safeClose(JarFile jf)
  8. scanJarPackageClass(List> classes, String packageDirName, String packageName, JarFile jar, boolean recursive)