查找类源码文件
@param soruceRootDir 源码目录
@param clazz 类
@return
188994
public File findJavaSourceFile(String soruceRootDir,Class<?> clazz)
	{
		String url = StringUtils.replace(clazz.getPackage().toString().split(" ")[1], ".",File.separator);
		String sourceFilename = soruceRootDir+url +File.separator + clazz.getSimpleName() + ".java";
		File javaSourceFile=new File(sourceFilename);
		return javaSourceFile;
	}
500434
public static List<Method> getAllDeclaredMethods(Class<?> clazz) {
		List<Method> result = new ArrayList<>();
		while (clazz != null) {
			Method[] methods = clazz.getDeclaredMethods();
			Collections.addAll(result, methods);
			clazz = clazz.getSuperclass();
		}
		return result;
	}
1329030
public static List<File> listDirs(final File dir)
	{
		final List<File> foundedDirs = new ArrayList<>();
		final File[] fileArray = dir.listFiles();
		for (final File element : fileArray)
		{
			if (element.isDirectory())
			{
				foundedDirs.add(element);
			}
		}
		return foundedDirs;

	}
604582
private static String stripEnding(final String clazz) {

		if (!clazz.endsWith("view")) {
			return clazz;
		}

		return clazz.substring(0, clazz.lastIndexOf("view"));
	}
868383
public static TomcatServiceBuilder forClassPath(Class<?> clazz, String docBaseOrJarRoot) {
        requireNonNull(clazz, "clazz");
        requireNonNull(docBaseOrJarRoot, "docBaseOrJarRoot");

        final ProtectionDomain pd = clazz.getProtectionDomain();
        if (pd == null) {
            throw new IllegalArgumentException(clazz + " does not have a protection domain.");
        }
        final CodeSource cs = pd.getCodeSource();
        if (cs == null) {
            throw new IllegalArgumentException(clazz + " does not have a code source.");
        }
        final URL url = cs.getLocation();
        if (url == null) {
            throw new IllegalArgumentException(clazz + " does not have a location.");
        }

        if (!"file".equalsIgnoreCase(url.getProtocol())) {
            throw new IllegalArgumentException(clazz + " is not on a file system: " + url);
        }

        File f;
        try {
            f = new File(url.toURI());
        } catch (URISyntaxException ignored) {
            f = new File(url.getPath());
        }

        if (TomcatUtil.isZip(f.toPath())) {
            return new TomcatServiceBuilder(f.toPath(), docBaseOrJarRoot);
        }

        f = fileSystemDocBase(f, docBaseOrJarRoot);

        if (!f.isDirectory()) {
            throw new IllegalArgumentException(f + " is not a directory.");
        }

        return forFileSystem(f.toPath());
    }
375806
private function getCommonTemplateDirectory()
    {
        $commonDirectory = realpath($this->templateDirectory . '/_newup/common');

        if ($this->files->exists($commonDirectory) && $this->files->isDirectory($commonDirectory)) {
            return $commonDirectory;
        }

        return null;
    }
1131153
private static boolean useBootClasspath(Class clazz) {
        try {
            ParallelWorldClassLoader.toJarUrl(clazz.getResource('/' + clazz.getName().replace('.', '/') + ".class"));
            return true;
        } catch (Exception e) {
            return false;
        }
    }
250645
public static URL findClassBase(Class clazz)
   {
      String resource = clazz.getName().replace('.', '/') + ".class";
      return findResourceBase(resource, clazz.getClassLoader());
   }
444904
public static ClassLoader getDefaultClassLoader(Class<?> clazz) {
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		if (classLoader == null) {
			classLoader = clazz.getClassLoader();
		}
		return classLoader;
	}
533558
private static String getVersion(final Class<?> clazz) {
		CodeSource source = clazz.getProtectionDomain().getCodeSource();
		URL location = source.getLocation();

		try {
			Path path = Paths.get(location.toURI());
			return Files.isRegularFile(path) ? getVersionFromJar(path) : getVersionFromPom(path);
		} catch (URISyntaxException ex) {
			Logger.error(ex, "Unknown location: \"{}\"", location);
			return null;
		}
	}
616640
@Deprecated
    public FilePath getModuleRoot() {
        AbstractBuild b = getBuildForDeprecatedMethods();
        return b != null ? b.getModuleRoot() : null;
    }
589161
public static List<File> listFile(File rootDir) {
		return Files.fileTreeTraverser().preOrderTraversal(rootDir).filter(Files.isFile()).toList();
	}
1017896
public static <T> Clazz<T> Clazz( Class<T> clazz )
	{
		return impl.Clazz( clazz );
	}
1366422
public static Stack<Class<?>> getClassHierarchy(final Class<?> clazz) {
        final Stack<Class<?>> classHierarchy = new Stack<Class<?>>();
        Class<?> c = clazz;
        while (c != null) {
            classHierarchy.push(c);
            c = (isStatic(c.getModifiers())) ? null : c.getEnclosingClass();
        }
        return classHierarchy;
    }
1174667
public static Map<String, Method> getClassWriteMethods(Class<?> clazz) {
		Map<String, Method> writeMethods = classWriteMethods.get(clazz);
		if (writeMethods == null) {
			cacheReadWriteMethodsAndBoxField(clazz);
			return classWriteMethods.get(clazz);
		} else
			return writeMethods;
	}
1364896
public static ClassLoader getClassLoader(Class clazz){
        ClassLoader classLoader = clazz.getClassLoader();
        return classLoader==null ? ClassLoader.getSystemClassLoader() : classLoader;
    }
756251
public static File getBootstrapLibDir() {
        if (libDir.get() == null) {
            libDir = StaticValue.mutateStaticValue(libDir, new Utils.FileInitializer(getBootstrapJar().getParentFile()));
        }
        return libDir.get();
    }