Examples of JarFileArchive


Examples of org.springframework.boot.loader.archive.JarFileArchive

  private static final AsciiBytes LIB = new AsciiBytes("lib/");

  public static ClassLoader createModuleClassLoader(Resource moduleLocation, ClassLoader parent) {
    try {
      File moduleFile = moduleLocation.getFile();
      Archive moduleArchive = moduleFile.isDirectory() ? new ExplodedArchive(moduleFile) : new JarFileArchive(moduleFile);
      List<Archive> nestedArchives = moduleArchive.getNestedArchives(new Archive.EntryFilter() {
        @Override
        public boolean matches(Archive.Entry entry) {
          return !entry.isDirectory() && entry.getName().startsWith(LIB);
        }
View Full Code Here

Examples of org.springframework.boot.loader.archive.JarFileArchive

    File root = new File(path);
    if (!root.exists()) {
      throw new IllegalStateException(
          "Unable to determine code source archive from " + root);
    }
    return (root.isDirectory() ? new ExplodedArchive(root) : new JarFileArchive(root));
  }
View Full Code Here

Examples of org.springframework.boot.loader.archive.JarFileArchive

  @Test
  public void archivedWarHasOnlyWebInfClassesAndContentsOfWebInfLibOnClasspath()
      throws Exception {
    File warRoot = createWarArchive();

    WarLauncher launcher = new WarLauncher(new JarFileArchive(warRoot));
    List<Archive> archives = launcher.getClassPathArchives();
    assertEquals(2, archives.size());

    assertThat(
        getUrls(archives),
View Full Code Here

Examples of org.springframework.boot.loader.archive.JarFileArchive

  }

  private Archive getArchive(File file) throws IOException {
    String name = file.getName().toLowerCase();
    if (name.endsWith(".jar") || name.endsWith(".zip")) {
      return new JarFileArchive(file);
    }
    return null;
  }
View Full Code Here

Examples of org.springframework.boot.loader.archive.JarFileArchive

  private void addParentClassLoaderEntries(List<Archive> lib) throws IOException,
      URISyntaxException {
    ClassLoader parentClassLoader = getClass().getClassLoader();
    for (URL url : getURLs(parentClassLoader)) {
      if (url.toString().endsWith(".jar") || url.toString().endsWith(".zip")) {
        lib.add(0, new JarFileArchive(new File(url.toURI())));
      }
      else if (url.toString().endsWith("/*")) {
        String name = url.getFile();
        File dir = new File(name.substring(0, name.length() - 1));
        if (dir.exists()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.