*
* @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);