Lines 18-24
Link Here
|
18 |
import java.io.InputStream; |
18 |
import java.io.InputStream; |
19 |
import java.net.URI; |
19 |
import java.net.URI; |
20 |
import java.net.URISyntaxException; |
20 |
import java.net.URISyntaxException; |
21 |
import java.nio.channels.FileChannel; |
|
|
22 |
import java.util.Date; |
21 |
import java.util.Date; |
23 |
import java.util.Enumeration; |
22 |
import java.util.Enumeration; |
24 |
import java.util.jar.JarFile; |
23 |
import java.util.jar.JarFile; |
Lines 91-102
Link Here
|
91 |
|
90 |
|
92 |
newJarFile.createNewFile(); |
91 |
newJarFile.createNewFile(); |
93 |
|
92 |
|
94 |
FileChannel in = new FileInputStream(tempFile).getChannel(); |
93 |
FileInputStream in = null; |
95 |
FileChannel out = new FileOutputStream(newJarFile).getChannel(); |
94 |
FileOutputStream out = null; |
96 |
in.transferTo( 0, in.size(), out); |
95 |
try { |
97 |
|
96 |
in = new FileInputStream(tempFile); |
98 |
in.close(); |
97 |
out = new FileOutputStream(newJarFile); |
99 |
out.close(); |
98 |
byte[] buffer = new byte[4096]; |
|
|
99 |
int len; |
100 |
while ((len=in.read(buffer)) != -1) { |
101 |
out.write(buffer, 0, len); |
102 |
} |
103 |
} finally { |
104 |
if (in != null) |
105 |
in.close(); |
106 |
if (out != null) |
107 |
out.close(); |
108 |
} |
100 |
} |
109 |
} |
101 |
|
110 |
|
102 |
public static void addToJar(JarOutputStream jos, JarFile jf) throws IOException { |
111 |
public static void addToJar(JarOutputStream jos, JarFile jf) throws IOException { |