Hi All,
Could anyone please help me resolve this problem :I want to download an entire directory .I am using the com.oreilly.servlet package .I am utilizing the ServletUtils class in it.Following is the code in it which I want to modify in order to download an entire directory/folder.Of course in the returnFile() method I am passing a Directory name rather than just a file name.
<code>
File f1=new File(dirname);
String s[]=f1.list();
int i;
for (i=0;i<s.length;i++)
{
byte[] buf=new byte[4 * 1024];
buf=s[i].getBytes();
out.write(buf);
}
</code>
I am getting a bit stuck in the above code as to how to output an array of bytes(the array contains the filenames in the directory as obtained by the list() method.) to the output stream.
Any help will be much appreciated.Thanks a lot.