Java Utililty Methods Jar Usage

List of utility methods to do Jar Usage

Description

The list of methods to do Jar Usage are organized into topic(s).

Method

voidprocess(Object obj)
process
JarEntry entry = (JarEntry) obj;
String name = entry.getName();
long size = entry.getSize();
long compressedSize = entry.getCompressedSize();
System.out.println(name + "\t" + size + "\t" + compressedSize);
voidprocessJarFile(String f)
process Jar File
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();
...
voidrecordFactoryDefault(String className, Attributes attributes)
record Factory Default
if (isSet(attributes, "Default-Factory")) {
    defaultFactoryClassName = className;
voidsafeClose(JarFile jf)
safe Close
try {
    if (jf != null) {
        jf.close();
} catch (Exception e) {
voidscanJarPackageClass(List> classes, String packageDirName, String packageName, JarFile jar, boolean recursive)
scan Jar Package Class
Enumeration<JarEntry> entries = jar.entries();
while (entries.hasMoreElements()) {
    JarEntry entry = entries.nextElement();
    String name = entry.getName();
    if (name.charAt(0) == '/') {
        name = name.substring(1);
    if (name.startsWith(packageDirName)) {
...