类 ApplicationHome
java.lang.Object
cn.taketoday.core.ApplicationHome
Provides access to the application home directory. Attempts to pick a sensible home for
both Jar Files, Exploded Archives and directly running applications.
- 从以下版本开始:
- 4.0 2022/1/16 23:14
- 作者:
- Phillip Webb, Raja Kolli, Harry Yang
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a newApplicationHomeinstance.ApplicationHome(Class<?> sourceClass) Create a newApplicationHomeinstance for the specified source class. -
方法概要
修饰符和类型方法说明private Fileprivate FilefindHomeDir(File source) private FilefindSource(Class<?> sourceClass) private FilefindSource(URL location) getDir()Returns the application home directory.private FilegetRootJarFile(JarFile jarFile) Returns the underlying source used to find the home directory.private Class<?>private Class<?>getStartClass(Enumeration<URL> manifestResources) private booleantoString()
-
字段详细资料
-
source
-
dir
-
-
构造器详细资料
-
ApplicationHome
public ApplicationHome()Create a newApplicationHomeinstance. -
ApplicationHome
Create a newApplicationHomeinstance for the specified source class.- 参数:
sourceClass- the source class ornull
-
-
方法详细资料
-
getStartClass
-
getStartClass
-
findSource
-
isUnitTest
private boolean isUnitTest() -
findSource
-
getRootJarFile
-
findHomeDir
-
findDefaultHomeDir
-
getSource
Returns the underlying source used to find the home directory. This is usually the jar file or a directory. Can returnnullif the source cannot be determined.- 返回:
- the underlying source or
null
-
getDir
Returns the application home directory.- 返回:
- the home directory (never
null)
-
toString
-