Returns the list of File objects for unique classpath elements (directories or jarfiles), in classloader
resolution order.

@return The unique classpath elements.
548223
public List<File> getClasspathFiles() {
        if (closed.get()) {
            throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
        }
        final List<File> classpathElementOrderFiles = new ArrayList<>();
        for (final ClasspathElement classpathElement : classpathOrder) {
            final File file = classpathElement.getFile();
            if (file != null) {
                classpathElementOrderFiles.add(file);
            }
        }
        return classpathElementOrderFiles;
    }
346031
private static List getClasses(final File current, final List list) {
		if (current.isDirectory()) {
			try {
				list.add(current.toURI().toURL());
			} catch (final Exception ignore) {
			}

			final File children[] = current.listFiles();

			for (int i = 0; i < children.length; i++) {
				final File element = children[i];
				CClassLoader.getClasses(element, list);
			}
		} else if (current.isFile()) {
			final String name = current.getName();

			if (name.endsWith(".class")) {
				try {
					list.add(current.toURI().toURL());
				} catch (final Exception ignore) {
				}
			} else if (name.endsWith(".jar")) {
				try {
					list.add(current.toURI().toURL());
				} catch (final Exception ignore) {
				}
			}
		}

		return list;
	}
20340
private void findNestedClasspathElements(final List<SimpleEntry<String, ClasspathElement>> classpathElts,
            final LogNode log) {
        // Sort classpath elements into lexicographic order
        CollectionUtils.sortIfNotEmpty(classpathElts, new Comparator<SimpleEntry<String, ClasspathElement>>() {
            @Override
            public int compare(final SimpleEntry<String, ClasspathElement> o1,
                    final SimpleEntry<String, ClasspathElement> o2) {
                return o1.getKey().compareTo(o2.getKey());
            }
        });
        // Find any nesting of elements within other elements
        for (int i = 0; i < classpathElts.size(); i++) {
            // See if each classpath element is a prefix of any others (if so, they will immediately follow
            // in lexicographic order)
            final SimpleEntry<String, ClasspathElement> ei = classpathElts.get(i);
            final String basePath = ei.getKey();
            final int basePathLen = basePath.length();
            for (int j = i + 1; j < classpathElts.size(); j++) {
                final SimpleEntry<String, ClasspathElement> ej = classpathElts.get(j);
                final String comparePath = ej.getKey();
                final int comparePathLen = comparePath.length();
                boolean foundNestedClasspathRoot = false;
                if (comparePath.startsWith(basePath) && comparePathLen > basePathLen) {
                    // Require a separator after the prefix
                    final char nextChar = comparePath.charAt(basePathLen);
                    if (nextChar == '/' || nextChar == '!') {
                        // basePath is a path prefix of comparePath. Ensure that the nested classpath does
                        // not contain another '!' zip-separator (since classpath scanning does not recurse
                        // to jars-within-jars unless they are explicitly listed on the classpath)
                        final String nestedClasspathRelativePath = comparePath.substring(basePathLen + 1);
                        if (nestedClasspathRelativePath.indexOf('!') < 0) {
                            // Found a nested classpath root
                            foundNestedClasspathRoot = true;
                            // Store link from prefix element to nested elements
                            final ClasspathElement baseElement = ei.getValue();
                            if (baseElement.nestedClasspathRootPrefixes == null) {
                                baseElement.nestedClasspathRootPrefixes = new ArrayList<>();
                            }
                            baseElement.nestedClasspathRootPrefixes.add(nestedClasspathRelativePath + "/");
                            if (log != null) {
                                log.log(basePath + " is a prefix of the nested element " + comparePath);
                            }
                        }
                    }
                }
                if (!foundNestedClasspathRoot) {
                    // After the first non-match, there can be no more prefix matches in the sorted order
                    break;
                }
            }
        }
    }
24660
public List<JavaClass> getAllClasses() {
        ClassDumpSegment classDumpBounds;

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

        classDumpBounds = getClassDumpSegment();

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

        return classDumpBounds.createClassCollection();
    }
1227913
public Set<String> getClasspaths() {
    	Set<String> classpaths = selectedRunner.getClasspaths();
       	return classpaths == null ? new HashSet<String>() : classpaths;
    }
857321
@Override
  public File[] getLibraryPath() {
    if (this.libDirs == null) {
      final Vector<String> dirs = new Vector<>();
      // Ask GCC where it will look for its libraries.
      final String[] args = new String[] {
          "g++", "-print-search-dirs"
      };
      final String[] cmdout = CaptureStreamHandler.run(args);
      for (int i = 0; i < cmdout.length; ++i) {
        final int prefixIndex = cmdout[i].indexOf(libPrefix);
        if (prefixIndex >= 0) {
          // Special case DOS-type GCCs like MinGW or Cygwin
          int s = prefixIndex + libPrefix.length();
          int t = cmdout[i].indexOf(';', s);
          while (t > 0) {
            dirs.addElement(cmdout[i].substring(s, t));
            s = t + 1;
            t = cmdout[i].indexOf(';', s);
          }
          dirs.addElement(cmdout[i].substring(s));
          ++i;
          for (; i < cmdout.length; ++i) {
            dirs.addElement(cmdout[i]);
          }
        }
      }
      // Eliminate all but actual directories.
      final String[] libpath = new String[dirs.size()];
      dirs.copyInto(libpath);
      final int count = CUtil.checkDirectoryArray(libpath);
      // Build return array.
      this.libDirs = new File[count];
      int index = 0;
      for (final String element : libpath) {
        if (element != null) {
          this.libDirs[index++] = new File(element);
        }
      }
    }
    return this.libDirs;
  }
977806
@Override
	public IClasspathEntry[] getClasspathEntries() {
		// TODO Auto-generated method stub
		List<IClasspathEntry> libraries = Activator.getDefault().libraries();
		return libraries.toArray(new IClasspathEntry[libraries.size()]);
	}
842873
protected List<File> getClassPath() throws IOException {
		final Set<String> classPath = new LinkedHashSet<>();
		classPath.add(this.session.getCurrentProject().getBuild().getSourceDirectory());
		try {
			classPath.addAll(this.session.getCurrentProject().getCompileClasspathElements());
		} catch (DependencyResolutionRequiredException e) {
			throw new IOException(e.getLocalizedMessage(), e);
		}
		for (final Artifact dep : this.session.getCurrentProject().getArtifacts()) {
			classPath.add(dep.getFile().getAbsolutePath());
		}
		classPath.remove(this.session.getCurrentProject().getBuild().getOutputDirectory());
		final List<File> files = new ArrayList<>();
		for (final String filename : classPath) {
			final File file = new File(filename);
			if (file.exists()) {
				files.add(file);
			}
		}
		return files;
	}
1087092
public static List<IClasspathEntry> getDefaultSourceClassPathEntries(IPath projectFolder) {
		final IPath srcJava = projectFolder.append(
				Path.fromPortableString(SARLConfig.FOLDER_SOURCE_JAVA));
		final IClasspathEntry srcJavaEntry = JavaCore.newSourceEntry(srcJava.makeAbsolute());

		final IPath srcSarl = projectFolder.append(
				Path.fromPortableString(SARLConfig.FOLDER_SOURCE_SARL));
		final IClasspathEntry srcSarlEntry = JavaCore.newSourceEntry(srcSarl.makeAbsolute());

		final IPath srcGeneratedSources = projectFolder.append(
				Path.fromPortableString(SARLConfig.FOLDER_SOURCE_GENERATED));
		final IClasspathAttribute attr = JavaCore.newClasspathAttribute(
				IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS,
				Boolean.TRUE.toString());
		final IClasspathEntry srcGeneratedSourcesEntry = JavaCore.newSourceEntry(
				srcGeneratedSources.makeAbsolute(),
				ClasspathEntry.INCLUDE_ALL,
				ClasspathEntry.EXCLUDE_NONE,
				null /*output location*/,
				new IClasspathAttribute[] {attr});

		final IPath srcResources = projectFolder.append(
				Path.fromPortableString(SARLConfig.FOLDER_RESOURCES));
		final IClasspathEntry srcResourcesEntry = JavaCore.newSourceEntry(srcResources.makeAbsolute());

		return Arrays.asList(
				srcSarlEntry,
				srcJavaEntry,
				srcResourcesEntry,
				srcGeneratedSourcesEntry);
	}
1371424
public File[] listFiles(String directoryPath) {
        File[] result = null;
        File directory = null;
        directory = new File(directoryPath);
        if (directory.isDirectory()) {
            result = directory.listFiles();
        }
        return result;
    }
1237548
protected List<File> getClassPath() throws MojoExecutionException {
		if (this.bufferedClasspath == null) {
			final Set<String> classPath = new LinkedHashSet<>();
			final MavenProject project = getProject();
			classPath.add(project.getBuild().getSourceDirectory());
			try {
				classPath.addAll(project.getCompileClasspathElements());
			} catch (DependencyResolutionRequiredException e) {
				throw new MojoExecutionException(e.getLocalizedMessage(), e);
			}
			for (final Artifact dep : project.getArtifacts()) {
				classPath.add(dep.getFile().getAbsolutePath());
			}
			classPath.remove(project.getBuild().getOutputDirectory());
			final List<File> files = new ArrayList<>();
			for (final String filename : classPath) {
				final File file = new File(filename);
				if (file.exists()) {
					files.add(file);
				} else {
					getLog().warn(MessageFormat.format(Messages.AbstractSarlBatchCompilerMojo_10, filename));
				}
			}
			this.bufferedClasspath = files;
		}
		return this.bufferedClasspath;
	}
143421
public static URL[] getClassPathJars(final Bundle bundle) {
		final List<URL> urls = new ArrayList<>();
		final String bundleClasspath = (String) bundle.getHeaders().get(
				"Bundle-ClassPath");
		if (bundleClasspath != null) {
			String[] segments = bundleClasspath.split(",");
			for (String segment : segments) {
				final URL url = bundle.getEntry(segment);
				if (url != null) {
					if (url.toExternalForm().endsWith("jar")) {
						LOG.debug("Using url: " + url);
						try {
							URL jarUrl = new URL("jar:" + url.toExternalForm()
									+ "!/");
							urls.add(jarUrl);
						} catch (MalformedURLException ignore) {
							LOG.debug(ignore.getMessage());
						}
					}
				}
			}
		}
		LOG.debug("Bundle-ClassPath URLs: " + urls);
		// adds the depending bundles to the "classloader" space
		urls.addAll(getLocationsOfBundlesInClassSpace(bundle));

		return urls.toArray(new URL[urls.size()]);
	}
262232
public static List<String> getJreJars() {
    String javaHome = System.getProperty("java.home");
    Path libsDir = FileSystems.getDefault().getPath(javaHome, "/lib");
    List<String> retval = GosucUtil.getIbmClasspath();
    try {
      retval.addAll(Files.walk(libsDir)
              .filter( path -> path.toFile().isFile())
              .filter( path -> path.toString().endsWith(".jar"))
              .map( Path::toString )
              .collect(Collectors.toList()));
    } catch (SecurityException | IOException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
    return retval;
  }
982831
public String getClasspath() {
        StringBuilder sb = new StringBuilder();
        boolean firstPass = true;
        Enumeration componentEnum = pathComponents.elements();
        while (componentEnum.hasMoreElements()) {
            if (!firstPass) {
                sb.append(System.getProperty("path.separator"));
            } else {
                firstPass = false;
            }
            sb.append(((File) componentEnum.nextElement()).getAbsolutePath());
        }
        return sb.toString();
    }
262146
def _get_classpath():
    
    try:
        orig_cp = os.environ['CLASSPATH']
    except KeyError:
        return []
    expanded_cp = []
    for i in orig_cp.split(os.path.pathsep):
        expanded_cp.extend(_jar_glob(i))
    return expanded_cp
127793
public List<String> selectJars(String targetPath) {
        List<String> jarPaths = new ArrayList<String>();

        if (targetPath == null) {
            return jarPaths;
        }

        File targetDir = new File(targetPath);
        if (!UtilImpl_FileUtils.exists(targetDir)) {
            return jarPaths;
        }

        File[] targetFiles = UtilImpl_FileUtils.listFiles(targetDir);
        if (targetFiles != null) {
            for (File nextTargetFile : targetFiles) {
                String nextTargetName = nextTargetFile.getName();
                if (nextTargetName.toUpperCase().endsWith(".JAR")) {
                    String nextTargetPath = targetPath + "/" + nextTargetName;
                    jarPaths.add(nextTargetPath);
                }
            }
        }

        return jarPaths;
    }
737364
private List<ClassNameWrapper> getJarClassNames(ClassLoader cl, File file, String packageName) {
    	List<ClassNameWrapper> classNames = new ArrayList<> ();
        ZipEntry entry = null;
        String className = "";
        try (JarFile jarFile = new JarFile(file)) {
            Enumeration<JarEntry> entries = jarFile.entries();
            while (entries.hasMoreElements()) {
                entry = entries.nextElement();
                if (entry.isDirectory() || !entry.getName().endsWith(".class")) {
                    continue;
                }
                className = entry.toString().replaceAll("\\.class$","").replaceAll("/",".");
                if (className.indexOf(packageName) >= 0) {
                    classNames.add(new ClassNameWrapper(cl, className));
                }
            }
        } catch (Exception e) {
        	logger.error("Failed to open file: " + file.getAbsolutePath(), e);
        }
        return classNames;
    }