|
Lines 34-39
Link Here
|
| 34 |
private boolean signing = false; |
34 |
private boolean signing = false; |
| 35 |
private boolean repacking = false; |
35 |
private boolean repacking = false; |
| 36 |
private boolean unpacking = false; |
36 |
private boolean unpacking = false; |
|
|
37 |
private boolean verbose = false; |
| 37 |
|
38 |
|
| 38 |
public void setWorkingDirectory(String dir) { |
39 |
public void setWorkingDirectory(String dir) { |
| 39 |
workingDirectory = dir; |
40 |
workingDirectory = dir; |
|
Lines 62-74
Link Here
|
| 62 |
this.unpacking = unpack; |
63 |
this.unpacking = unpack; |
| 63 |
} |
64 |
} |
| 64 |
|
65 |
|
|
|
66 |
public void setVerbose(boolean verbose) { |
| 67 |
this.verbose = verbose; |
| 68 |
} |
| 69 |
|
| 65 |
public void processZip(File zipFile) throws ZipException, IOException { |
70 |
public void processZip(File zipFile) throws ZipException, IOException { |
|
|
71 |
if (verbose) |
| 72 |
System.out.println("Processing " + zipFile.getPath()); //$NON-NLS-1$ |
| 66 |
ZipFile zip = new ZipFile(zipFile); |
73 |
ZipFile zip = new ZipFile(zipFile); |
| 67 |
initialize(zip); |
74 |
initialize(zip); |
| 68 |
|
75 |
|
| 69 |
String extension = unpacking ? "pack.gz" : ".jar"; //$NON-NLS-1$ //$NON-NLS-2$ |
76 |
String extension = unpacking ? "pack.gz" : ".jar"; //$NON-NLS-1$ //$NON-NLS-2$ |
| 70 |
File tempDir = new File(getWorkingDirectory(), "temp_" + zipFile.getName()); //$NON-NLS-1$ |
77 |
File tempDir = new File(getWorkingDirectory(), "temp_" + zipFile.getName()); //$NON-NLS-1$ |
| 71 |
JarProcessor processor = new JarProcessor(); |
78 |
JarProcessor processor = new JarProcessor(); |
|
|
79 |
processor.setVerbose(verbose); |
| 72 |
processor.setWorkingDirectory(tempDir.getCanonicalPath()); |
80 |
processor.setWorkingDirectory(tempDir.getCanonicalPath()); |
| 73 |
if (unpacking) { |
81 |
if (unpacking) { |
| 74 |
processor.addProcessStep(unpackStep); |
82 |
processor.addProcessStep(unpackStep); |
|
Lines 97-102
Link Here
|
| 97 |
parent = extractedFile.getParentFile(); |
105 |
parent = extractedFile.getParentFile(); |
| 98 |
if (!parent.exists()) |
106 |
if (!parent.exists()) |
| 99 |
parent.mkdirs(); |
107 |
parent.mkdirs(); |
|
|
108 |
if (verbose) |
| 109 |
System.out.println("Extracting " + entry.getName()); //$NON-NLS-1$ |
| 100 |
FileOutputStream extracted = new FileOutputStream(extractedFile); |
110 |
FileOutputStream extracted = new FileOutputStream(extractedFile); |
| 101 |
Utils.transferStreams(entryStream, extracted, true); |
111 |
Utils.transferStreams(entryStream, extracted, true); |
| 102 |
|
112 |
|
|
Lines 127-132
Link Here
|
| 127 |
} |
137 |
} |
| 128 |
} |
138 |
} |
| 129 |
entryStream = new FileInputStream(extractedFile); |
139 |
entryStream = new FileInputStream(extractedFile); |
|
|
140 |
if (verbose) { |
| 141 |
System.out.println("Adding " + entry.getName() + " to " + outputFile.getPath()); //$NON-NLS-1$ //$NON-NLS-2$ |
| 142 |
System.out.println(); |
| 143 |
} |
| 130 |
} |
144 |
} |
| 131 |
ZipEntry newEntry = new ZipEntry(name); |
145 |
ZipEntry newEntry = new ZipEntry(name); |
| 132 |
zipOut.putNextEntry(newEntry); |
146 |
zipOut.putNextEntry(newEntry); |
|
Lines 158-165
Link Here
|
| 158 |
stream = zip.getInputStream(entry); |
172 |
stream = zip.getInputStream(entry); |
| 159 |
properties.load(stream); |
173 |
properties.load(stream); |
| 160 |
} catch (IOException e) { |
174 |
} catch (IOException e) { |
| 161 |
// TODO Auto-generated catch block |
175 |
if (verbose) |
| 162 |
e.printStackTrace(); |
176 |
e.printStackTrace(); |
| 163 |
} finally { |
177 |
} finally { |
| 164 |
Utils.close(stream); |
178 |
Utils.close(stream); |
| 165 |
} |
179 |
} |
|
Lines 168-176
Link Here
|
| 168 |
packExclusions = Utils.getPackExclusions(properties); |
182 |
packExclusions = Utils.getPackExclusions(properties); |
| 169 |
signExclusions = Utils.getSignExclusions(properties); |
183 |
signExclusions = Utils.getSignExclusions(properties); |
| 170 |
|
184 |
|
| 171 |
packUnpackStep = new PackUnpackStep(properties); |
185 |
packUnpackStep = new PackUnpackStep(properties, verbose); |
| 172 |
packStep = new PackStep(properties); |
186 |
packStep = new PackStep(properties, verbose); |
| 173 |
signStep = new SignCommandStep(properties, command); |
187 |
signStep = new SignCommandStep(properties, command, verbose); |
| 174 |
unpackStep = new UnpackStep(properties); |
188 |
unpackStep = new UnpackStep(properties, verbose); |
| 175 |
} |
189 |
} |
| 176 |
} |
190 |
} |