Class JarContext

java.lang.Object
icu.easyj.core.util.jar.JarContext

public class JarContext extends Object
加载JAR信息时的上下文
Author:
wangliang181230
  • Constructor Details

  • Method Details

    • getJarFilePath

      public String getJarFilePath()
    • getName

      public String getName()
    • getVersionInfo

      public VersionInfo getVersionInfo()
    • setVersionInfo

      public void setVersionInfo(VersionInfo versionInfo)
    • setVersion

      public void setVersion(String version)
    • getManifest

      public Manifest getManifest()
    • getAttributes

      public Attributes getAttributes()
    • getAttribute

      public String getAttribute(String attributeName)
    • getAttribute

      public String getAttribute(Attributes.Name attributeName)
    • getJarFile

      public JarFile getJarFile()
    • getResources

      @NonNull public org.springframework.core.io.Resource[] getResources(String locationPattern)
      在JAR包中检索资源
      Parameters:
      locationPattern - 资源路径匹配串
      Returns:
      resources 资源列表
    • getResource

      @Nullable public org.springframework.core.io.Resource getResource(String locationPattern)
      在JAR包中检索单个资源
      Parameters:
      locationPattern - 资源路径匹配串
      Returns:
      resource 目标资源
    • getClassNames

      @NonNull public List<String> getClassNames()
      通过所有class文件的路径,获取JAR包中所有类的类路径列表
      Returns:
      classNames 类路径列表
    • getClassPackages

      @NonNull public Set<String> getClassPackages(int numberOfTheDot)
      获取JAR里面的类的包名集合
      Parameters:
      numberOfTheDot - 获取包里面第n个点前面的内容
      Returns:
      包集合