Search Archive for classes.
@param the archive file location
@return array of class names found
@throws IOException
357877
static String [] searchArchiveForClasses( URL url ) throws IOException {
        List<String> list = new ArrayList<>();
        ZipInputStream zip = new ZipInputStream(url.openStream());

        ZipEntry ze;
        while( zip.available() == 1 )
            if ( (ze = zip.getNextEntry()) != null
                    && isClassFileName( ze.getName() ) )
                list.add( canonicalizeClassName( ze.getName() ) );
        zip.close();

        return list.toArray( new String[list.size()] );
    }
334051
def archive_filenames(self):
        """"""
        try:
            return _bfd.archive_list_filenames(self._ptr)
        except TypeError, err:
            raise BfdException(err)
494818
protected List<ScriptArchiveCompiler> findCompilers(ScriptArchive archive) {
        List<ScriptArchiveCompiler> candidateCompilers = new ArrayList<ScriptArchiveCompiler>();
        for (ScriptArchiveCompiler compiler : compilers) {
            if (compiler.shouldCompile(archive)) {
                candidateCompilers.add(compiler);
            }
        }
        return candidateCompilers;
    }
220710
protected List<String> classNames() {
        log("Searching for class names including " + includes + " and excluding " + excludes, MSG_DEBUG);
        List<String> classNames = newStoryFinder().findClassNames(searchDirectory(), includes, excludes);
        log("Found class names : " + classNames, MSG_INFO);
        return classNames;
    }
1267841
static String [] traverseDirForClasses( File dir )
        throws IOException
    {
        List list = traverseDirForClassesAux( dir, dir );
        return (String[])list.toArray( new String[0] );
    }
1349501
protected function findAndLoadClasses()
    {
        ob_start();

        $this->findFilesInProjectPath()
            ->each(function ($file) {
                try {
                    require_once $file->getRealPath();
                } catch (Exception $e) {
                }
            });

        ob_end_clean();

        return collect(get_declared_classes());
    }
555861
def search_archive(pattern, archive, verbosity=0, interactive=True):
    """"""
    if not pattern:
        raise util.PatoolError("empty search pattern")
    util.check_existing_filename(archive)
    if verbosity >= 0:
        util.log_info("Searching %r in %s ..." % (pattern, archive))
    res = _search_archive(pattern, archive, verbosity=verbosity, interactive=interactive)
    if res == 1 and verbosity >= 0:
        util.log_info("... %r not found" % pattern)
    return res
1287513
public List<? extends Archive> asList(final Class<? extends Archive> archive) {

      final List<Archive> archives = new ArrayList<>();
      final GradleEffectiveDependencies gradleEffectiveDependencies = GradleRunner.getEffectiveDependencies(projectDirectory);

      for (ScopeType scopeType : scopeTypesDependencies) {
         final List<File> dependenciesByScope = gradleEffectiveDependencies.getDependenciesByScope(scopeType);
         for (File dependency : dependenciesByScope) {
            try {
               final Archive dep = ShrinkWrap.create(ZipImporter.class, dependency.getName()).importFrom(dependency).as(archive);
               archives.add(dep);
            } catch (Exception e) {
               log.log(Level.WARNING, "Cannot import gradle dependency " + dependency + ". Not a zip-like format", e);
            }
         }
      }
      return archives;
   }
780340
protected List<File> findEntityClassFiles() throws MojoExecutionException {
        try {
            return FileUtils.getFiles(classes, includes, excludes);
        } catch (IOException e) {
            throw new MojoExecutionException("Error while scanning for '" + includes + "' in " + "'"
                    + classes.getAbsolutePath() + "'.", e);
        }
    }
1080372
public Archive[] as(final Class<? extends Archive> archive) {
      final List<? extends Archive> archives = asList(archive);
      return archives.toArray(new Archive[archives.size()]);
   }
1147362
public static ImmutableSet<File> findJarFiles(ClassLoader first, ClassLoader... rest)
      throws IOException {
    Scanner scanner = new Scanner();
    Map<URI, ClassLoader> map = Maps.newLinkedHashMap();
    for (ClassLoader classLoader : Lists.asList(first, rest)) {
      map.putAll(getClassPathEntries(classLoader));
    }
    for (Map.Entry<URI, ClassLoader> entry : map.entrySet()) {
      scanner.scan(entry.getKey(), entry.getValue());
    }
    return scanner.jarFiles();
  }
114025
public function getClasses()
    {
        if (!isset($this->fileClasses)) {
            $this->fileClasses = $this->findClasses();
        }

        return $this->fileClasses;
    }
931153
private List<Archive> getClassPathArchives(String cpaths, List<Path> initialArchives)
            throws IOException
    {
        List<Archive> result = new ArrayList<>();
        if (cpaths.isEmpty()) {
            return result;
        }

        List<Path> paths = new ArrayList<>();
        for (String p : cpaths.split(File.pathSeparator)) {
            if (p.length() > 0) {
                // wildcard to parse all JAR files e.g. -classpath dir/*
                int i = p.lastIndexOf(".*");
                if (i > 0) {
                    Path dir = Paths.get(p.substring(0, i));
                    try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.jar")) {
                        for (Path entry : stream) {
                            paths.add(entry);
                        }
                    }
                } else {
                    paths.add(Paths.get(p));
                }
            }
        }
        for (Path p : paths) {
            if (Files.exists(p) && !hasSameFile(initialArchives, p)) {
                result.add(Archive.getInstance(p));
            }
        }
        return result;
    }
365498
private void findFiles(File directory) throws IOException, ClassNotFoundException {

        File[] files = directory.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.endsWith(".class");
            }
        });

        if (files != null) {
            for (File file : files) {
                int current = currentDirectoryPath.length();
                String fileName = file.getCanonicalPath().substring(++current);
                String className = fileName.replace(File.separatorChar, '.').substring(0, fileName.length() - 6);
                tryClass(className);
            }
        }
    }
347261
public static Iterator<Class<?>> nonindexedClasses() {
    if(MASTER_CACHE == null) {
      initialize();
    }
    if(MASTER_CACHE.isEmpty()) {
      return Collections.emptyIterator();
    }
    return MASTER_CACHE.iterator();
  }
1040341
@SuppressWarnings("deprecation")
    @Override
    public final URL[] findResourcesByClasspath()
    {
        List<URL> list = new ArrayList<URL>();
        String classpath = System.getProperty("java.class.path");
        StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);

        while (tokenizer.hasMoreTokens())
        {
            String path = tokenizer.nextToken();

            File fp = new File(path);
            if (!fp.exists())
                throw new ResourceReadingException("File in java.class.path does not exist: " + fp);
            try
            {
                list.add(fp.toURL());
            }
            catch (MalformedURLException e)
            {
                throw new ResourceReadingException(e);
            }
        }
        return list.toArray(new URL[list.size()]);
    }
24660
public List<JavaClass> getAllClasses() {
        ClassDumpSegment classDumpBounds;

        if (heapDumpSegment == null) {
            return Collections.emptyList();
        }

        classDumpBounds = getClassDumpSegment();

        if (classDumpBounds == null) {
            return Collections.emptyList();
        }

        return classDumpBounds.createClassCollection();
    }