public final class Files extends Object
| Modifier and Type | Method and Description |
|---|---|
static Collection<File> |
allDirs(File dir)
Returns all directories found in the given directory and its descendants.
|
static Collection<File> |
allFiles(File dir)
Returns all (non-directory) files found in the given directory and its descendants.
|
static Collection<File> |
classFiles(File dir)
Returns all class files found in the given directory and its descendants..
|
static Set<File> |
classPathFor(ClassLoader loader,
Collection<String> packageNames)
Returns the files from the given ClassLoader that contain the given packages.
|
static Set<File> |
classPathFor(ClassLoader loader,
String... packageNames)
Returns the files from the given ClassLoader that contain the given packages.
|
static Set<File> |
classPathFor(Collection<String> packageNames)
Returns the files on the current class path that contain the given packages.
|
static Set<File> |
classPathFor(String... packageNames)
Returns the files on the current class path that contain the given packages.
|
static Optional<File> |
toClassFile(URL url)
If the given URL represents a class file or directory, returns the file path.
|
static File |
toFile(URL url)
Returns the file represented by the given URL:
|
static Optional<File> |
toJarFile(URL url)
If the given URL represents a JAR file, returns the file path.
|
public static Collection<File> allFiles(File dir)
public static Collection<File> allDirs(File dir)
public static Collection<File> classFiles(File dir)
public static Set<File> classPathFor(String... packageNames)
public static Set<File> classPathFor(ClassLoader loader, String... packageNames)
public static Set<File> classPathFor(Collection<String> packageNames)
public static Set<File> classPathFor(ClassLoader loader, Collection<String> packageNames)
public static Optional<File> toClassFile(URL url)
public static Optional<File> toJarFile(URL url)
Copyright © 2025 The Cornutum Project. All rights reserved.