|
|
|
|
@ -80,20 +80,31 @@ public final class CommandLineInvoker {
@@ -80,20 +80,31 @@ public final class CommandLineInvoker {
|
|
|
|
|
|
|
|
|
|
})[0]; |
|
|
|
|
ZipInputStream input = new ZipInputStream(new FileInputStream(zip)); |
|
|
|
|
ZipEntry entry; |
|
|
|
|
while ((entry = input.getNextEntry()) != null) { |
|
|
|
|
File file = new File(unpacked, entry.getName()); |
|
|
|
|
if (entry.isDirectory()) { |
|
|
|
|
file.mkdirs(); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
file.getParentFile().mkdirs(); |
|
|
|
|
StreamUtils.copy(input, new FileOutputStream(file)); |
|
|
|
|
if (entry.getName().endsWith("/bin/spring")) { |
|
|
|
|
file.setExecutable(true); |
|
|
|
|
try { |
|
|
|
|
ZipEntry entry; |
|
|
|
|
while ((entry = input.getNextEntry()) != null) { |
|
|
|
|
File file = new File(unpacked, entry.getName()); |
|
|
|
|
if (entry.isDirectory()) { |
|
|
|
|
file.mkdirs(); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
file.getParentFile().mkdirs(); |
|
|
|
|
FileOutputStream output = new FileOutputStream(file); |
|
|
|
|
try { |
|
|
|
|
StreamUtils.copy(input, output); |
|
|
|
|
if (entry.getName().endsWith("/bin/spring")) { |
|
|
|
|
file.setExecutable(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
finally { |
|
|
|
|
output.close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
finally { |
|
|
|
|
input.close(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
File bin = new File(unpacked.listFiles()[0], "bin"); |
|
|
|
|
File launchScript = new File(bin, isWindows() ? "spring.bat" : "spring"); |
|
|
|
|
|