Menu

#14 Attachment writing code (writeInputFile in edu.sdsc.nbcr.opal.AppServiceImpl) doesn't error check properly (patch included)

v1.0_(example)
closed-fixed
nobody
None
5
2014-06-09
2014-06-06
James
No

I had a problem where attachements set with the setAttachment method of InputFileType were not being copied to the working directory and no error messages were reported. On investigation I discovered that the reason my attachments weren't working was that I was uing a custom DataSource inside my DataHandler and the writeInputFile method in edu.sdsc.nbcr.opal.AppServiceImpl expects the getName method to return a path to a file. I assume that the DataHandler was expected to be wraping a FileDataSource.

The attached patch attempts to make the writeInputFile method more robust by adding error checking and allowing for a DataHandler that wraps things other then FileDataSource (via the DataHandler method writeTo). At the same time it will still do the efficent file rename for a wrapped FileDataSource but will use the getFile method of FileDataSource to access the underlying file instead of getName.

The patch can be applied to the current opal distribution with the commands:
cd opal-ws-2.5
patch -p1 -i ../PATH_TO_PATCH/opal_attachment.patch

1 Attachments

Discussion

  • Luca Clementi

    Luca Clementi - 2014-06-09
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →