Java Jar Usage containsClass(JarFile jarFile, String classFilePath)

Here you can find the source of containsClass(JarFile jarFile, String classFilePath)

Description

contains Class

License

Open Source License

Declaration

static boolean containsClass(JarFile jarFile, String classFilePath) 

Method Source Code

//package com.java2s;

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

public class Main {
    static boolean containsClass(JarFile jarFile, String classFilePath) {
        final Enumeration<JarEntry> entries = jarFile.entries();
        while (entries.hasMoreElements()) {
            final JarEntry entry = entries.nextElement();
            if ((!entry.isDirectory()) && entry.getName().contains(classFilePath)) {
                return true;
            }//  ww  w.jav  a 2  s .c  o  m
        }
        return false;
    }
}

Related

  1. _getPacker()
  2. allocateReadOnlyDictionary(final Attributes attributes)
  3. allocateReadOnlyI18nDictionary(final Attributes attributes, final ResourceBundle resourceBundle)
  4. checkJarValidity(String path)
  5. containsClass(JarFile jarFile, String agentRunnerClassName)
  6. convertAttributes(Attributes attributes)
  7. createPacker()
  8. findClassesByJar(String packageName, JarFile jar, final boolean recursive, Set> classes)
  9. getAttribute(String name, String value)