Package org.springframework.boot.loader.jar

Examples of org.springframework.boot.loader.jar.JarFile


  public JarFileArchive(File file) throws IOException {
    this(file, null);
  }

  public JarFileArchive(File file, URL url) throws IOException {
    this(new JarFile(file));
    this.url = url;
  }
View Full Code Here


  protected Archive getNestedArchive(Entry entry) throws IOException {
    JarEntryData data = ((JarFileEntry) entry).getJarEntryData();
    if (data.getComment().startsWith(UNPACK_MARKER)) {
      return getUnpackedNestedArchive(data);
    }
    JarFile jarFile = this.jarFile.getNestedJarFile(data);
    return new JarFileArchive(jarFile);
  }
View Full Code Here

    }
  }

  @Override
  public Archive getFilteredArchive(final EntryRenameFilter filter) throws IOException {
    JarFile filteredJar = this.jarFile.getFilteredJarFile(new JarEntryFilter() {
      @Override
      public AsciiBytes apply(AsciiBytes name, JarEntryData entryData) {
        return filter.apply(name, new JarFileEntry(entryData));
      }
    });
View Full Code Here

        public Object run() throws ClassNotFoundException {
          String path = name.replace('.', '/').concat(".class");
          for (URL url : getURLs()) {
            try {
              if (url.getContent() instanceof JarFile) {
                JarFile jarFile = (JarFile) url.getContent();
                // Check the jar entry data before needlessly creating the
                // manifest
                if (jarFile.getJarEntryData(path) != null
                    && jarFile.getManifest() != null) {
                  definePackage(packageName, jarFile.getManifest(), url);
                  return null;
                }

              }
            }
View Full Code Here

  @Test
  public void resolveFromNested() throws Exception {
    File file = this.temporaryFolder.newFile();
    TestJarCreator.createTestJar(file);
    JarFile jarFile = new JarFile(file);
    URL url = jarFile.getUrl();
    LaunchedURLClassLoader loader = new LaunchedURLClassLoader(new URL[] { url },
        null);
    URL resource = loader.getResource("nested.jar!/3.dat");
    assertThat(resource.toString(), equalTo(url + "nested.jar!/3.dat"));
    assertThat(resource.openConnection().getInputStream().read(), equalTo(3));
View Full Code Here

TOP

Related Classes of org.springframework.boot.loader.jar.JarFile

Copyright © 2018 www.massapicom. 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.