for (String filename : files) {
FileEntry fileEntry = createFileEntry(filename, edition, containerFiles);
if (fileEntry != null) {
- putDir.addFileEntry(fileEntry);
+ try {
+ putDir.addFileEntry(fileEntry);
+ } catch (IOException ioe1) {
+ fireProjectInsertFinished(false, ioe1);
+ return;
+ }
}
}
*
* @param fileEntry
* The file entry to add to the directory
+ * @throws IOException
+ * if an I/O error occurs when creating the payload stream
*/
- public void addFileEntry(FileEntry fileEntry) {
+ public void addFileEntry(FileEntry fileEntry) throws IOException {
if (fileEntry instanceof DirectFileEntry) {
if (payloadFile == null) {
try {
payloadOutputStream.flush();
fileEntries.add(fileEntry);
} catch (IOException ioe1) {
- /* hmm, ignore? */
+ payloadFile.delete();
+ throw ioe1;
} finally {
Closer.close(payloadOutputStream);
Closer.close(payloadInputStream);