Commit 3c15e659 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Better cleanup logic with Pack files.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3375 b35dd754-fafc-0310-a699-88a17e54d16e
parent 154816dd
...@@ -55,7 +55,7 @@ public class ServerStarter { ...@@ -55,7 +55,7 @@ public class ServerStarter {
* started and the server starter should not be used again. * started and the server starter should not be used again.
*/ */
private void start() { private void start() {
// setup the classpath using JiveClassLoader // Setup the classpath using JiveClassLoader
try { try {
// Load up the bootstrap container // Load up the bootstrap container
final ClassLoader parent = findParentClassLoader(); final ClassLoader parent = findParentClassLoader();
...@@ -134,6 +134,13 @@ public class ServerStarter { ...@@ -134,6 +134,13 @@ public class ServerStarter {
try { try {
String jarName = packedFile.getName().substring(0, String jarName = packedFile.getName().substring(0,
packedFile.getName().length() - ".pack".length()); packedFile.getName().length() - ".pack".length());
// Delete JAR file with same name if it exists (could be due to upgrade
// from old Wildfire release).
File jarFile = new File(libDir, jarName);
if (jarFile.exists()) {
jarFile.delete();
}
InputStream in = new BufferedInputStream(new FileInputStream(packedFile)); InputStream in = new BufferedInputStream(new FileInputStream(packedFile));
JarOutputStream out = new JarOutputStream(new BufferedOutputStream( JarOutputStream out = new JarOutputStream(new BufferedOutputStream(
new FileOutputStream(new File(libDir, jarName)))); new FileOutputStream(new File(libDir, jarName))));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment