i have a array of bytes store in disk using ZK Framework
later i need to retrieve this array of bytes and create a file the real file
i need later pass it to the a gallery on image using Javascript jquery plugin
which uses the following pattern to show the images.
<h:a href="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/800px-Bohinjsko_jezero_2.jpg">
<h:img src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/100px-Bohinjsko_jezero_2.jpg"/>
what have i solved so far?
i have create the file using the array of bytes using CommonsIO
is OK. i was wondering if java7 have a mehod to create the file from a arrayofBytes
which is not important for now.
as you can see the main important thing here is the plugin needs to source to my file image
<h:img src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/46/Bohinjsko_jezero_2.jpg/100px-Bohinjsko_jezero_2.jpg"/>
i have create a file in temp directory
but this directory is unreacheable to the browser i guess because is firing an error image not found my solution is to create the file image
inside image folder inside WEBCONTENT/image
folder which it works using static images my question is..
how can i get the full path to my app directory programmatically? something like
C:\app\eclipse\myproject\WebContent\img\temporals
for later to create here the temporal file
there is a better approach i only have the array of bytes of the image at start..
thanks a lot..