Showing posts with label sample code. Show all posts
Showing posts with label sample code. Show all posts
This Java - Create Zip file in memory - Read Now

This Java - Create Zip file in memory - Read Now

I find myself writing and rewriting this piece of code whenever I want to zip a set of files (in memory) and return the zipped file back as an object in memory. I often use this when the user requests a download of multiple reports and the deployment environment doesn't allow for disk access.I thought I'd post it here so that I could copy-paste it the next time I need it :) If you've stumbled
This Print JNDI tree - Read Now

This Print JNDI tree - Read Now

At one point or another most of us would have wanted to see what was in the JNDI tree of the Application Server. This may have been because of a javax.naming.NameNotFoundException thrown by the application under development.After scouring the internet and not finding a way to do this seemingly simple task, I put this together in about an hours time.

import java.util.Hashtable;

import