|
|
|
|
@ -16,10 +16,6 @@
@@ -16,10 +16,6 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.loader; |
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
import java.net.URI; |
|
|
|
|
import java.security.CodeSource; |
|
|
|
|
import java.security.ProtectionDomain; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.jar.JarEntry; |
|
|
|
|
@ -27,8 +23,6 @@ import java.util.jar.JarEntry;
@@ -27,8 +23,6 @@ import java.util.jar.JarEntry;
|
|
|
|
|
import org.springframework.boot.loader.archive.Archive; |
|
|
|
|
import org.springframework.boot.loader.archive.Archive.Entry; |
|
|
|
|
import org.springframework.boot.loader.archive.Archive.EntryFilter; |
|
|
|
|
import org.springframework.boot.loader.archive.ExplodedArchive; |
|
|
|
|
import org.springframework.boot.loader.archive.JarFileArchive; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Base class for executable archive {@link Launcher}s. |
|
|
|
|
@ -48,22 +42,6 @@ public abstract class ExecutableArchiveLauncher extends Launcher {
@@ -48,22 +42,6 @@ public abstract class ExecutableArchiveLauncher extends Launcher {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Archive createArchive() throws Exception { |
|
|
|
|
ProtectionDomain protectionDomain = getClass().getProtectionDomain(); |
|
|
|
|
CodeSource codeSource = protectionDomain.getCodeSource(); |
|
|
|
|
URI location = (codeSource == null ? null : codeSource.getLocation().toURI()); |
|
|
|
|
String path = (location == null ? null : location.getPath()); |
|
|
|
|
if (path == null) { |
|
|
|
|
throw new IllegalStateException("Unable to determine code source archive"); |
|
|
|
|
} |
|
|
|
|
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)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected final Archive getArchive() { |
|
|
|
|
return this.archive; |
|
|
|
|
} |
|
|
|
|
|