Package com.google.common.reflect
Class ClassPath.DefaultScanner
- java.lang.Object
-
- com.google.common.reflect.ClassPath.Scanner
-
- com.google.common.reflect.ClassPath.DefaultScanner
-
- Enclosing class:
- ClassPath
static final class ClassPath.DefaultScanner extends ClassPath.Scanner
-
-
Field Summary
Fields Modifier and Type Field Description private SetMultimap<java.lang.ClassLoader,java.lang.String>resources
-
Constructor Summary
Constructors Constructor Description DefaultScanner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ImmutableSet<ClassPath.ResourceInfo>getResources()private voidscanDirectory(java.io.File directory, java.lang.ClassLoader classloader, java.lang.String packagePrefix, java.util.Set<java.io.File> currentPath)Recursively scan the given directory, adding resources for each file encountered.protected voidscanDirectory(java.lang.ClassLoader classloader, java.io.File directory)Called when a directory is scanned for resource files.protected voidscanJarFile(java.lang.ClassLoader classloader, java.util.jar.JarFile file)Called when a jar file is scanned for resource entries.-
Methods inherited from class com.google.common.reflect.ClassPath.Scanner
getClassPathEntries, getClassPathEntry, getClassPathFromManifest, parseJavaClassPath, scan, scan
-
-
-
-
Field Detail
-
resources
private final SetMultimap<java.lang.ClassLoader,java.lang.String> resources
-
-
Method Detail
-
getResources
ImmutableSet<ClassPath.ResourceInfo> getResources()
-
scanJarFile
protected void scanJarFile(java.lang.ClassLoader classloader, java.util.jar.JarFile file)Description copied from class:ClassPath.ScannerCalled when a jar file is scanned for resource entries.- Specified by:
scanJarFilein classClassPath.Scanner
-
scanDirectory
protected void scanDirectory(java.lang.ClassLoader classloader, java.io.File directory) throws java.io.IOExceptionDescription copied from class:ClassPath.ScannerCalled when a directory is scanned for resource files.- Specified by:
scanDirectoryin classClassPath.Scanner- Throws:
java.io.IOException
-
scanDirectory
private void scanDirectory(java.io.File directory, java.lang.ClassLoader classloader, java.lang.String packagePrefix, java.util.Set<java.io.File> currentPath) throws java.io.IOExceptionRecursively scan the given directory, adding resources for each file encountered. Symlinks which have already been traversed in the current tree path will be skipped to eliminate cycles; otherwise symlinks are traversed.- Parameters:
directory- the root of the directory to scanclassloader- the classloader that includes resources found indirectorypackagePrefix- resource path prefix insideclassloaderfor any files found underdirectorycurrentPath- canonical files already visited in the current directory tree path, for cycle elimination- Throws:
java.io.IOException
-
-