We were building an ADF application hosted on JCS-SX. Among other things, the application had to create a zipped data file based on a BLOB uploaded into a DBCS table and upload the zipped file to Oracle Cloud UCM. The way we have been doing this till then was to use the ZipOutputStream Java class to create the ZIP file on the JCS-SX filesystem. We, however, ran into a problem when we had to migrate the application from JCS-SX to JCS which meant that we did not have access to the filesystem in which to create the zipped file. We could, of course, have used a separate server, SSHed into in and created the zipped file there. But that seemed too much a hassle. It is times like that that force you to reconsider your solution design and find a way out. Well, that is precisely what we did and realized much to our chagrin that we could have easily created the zipped file directly in DBCS itself using plain-old Oracle database APIs. There was no need to include the additional complexity of downloading the BLOB from the table and writing a zipped file in the filesystem.
We ended up using the APEX APIs APEX_ZIP.ADD_FILE and APEX_ZIP.FINISH to create the zipped file in DBCS itself which removed the need to interact with the filesystem. We could also have used UTL_COMPRESS.LZ_COMPRESS for the same purpose.
Moral of the story: When you happen to have a hammer, do not assume that everything can be fixed with just brute blows. Step back and think if you can do the job more easily using a screwdriver instead.