I want to make a servlet which catches all accesses to *.swf files (with a mapping)
and only retrieves them if the permissions for the user allow it.
That can be done simply with:
<code>
// check user permissions and redirect to error page if needed
// else:
response.setContentType("application/x-shockwave-flash");
DataInputStream dis = new DataInputStream(
getServletContext().getResourceAsStream(filename)
);
OutputStream out = response.getOutputStream();
int b = -1;
while((b = dis.read()) != -1) {
out.write(b);
}
out.close();
</code>
My question: is this approach more expensive than simply retrieving the file? If so,
is it significative?
Best regards,
Carlos Pereira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]