What's the simplest way to see if a file exists on the server in JSP?
If possible, I'd like the the equivalent of:
<%
if(FunctionThatTellsMeFileExists("images/001.png")) {
out.println("YES");
}
else {
out.println("NO");
}
%>

Signature
Sugapablo
http://www.sugapablo.net
Carl - 27 Mar 2006 21:29 GMT
> What's the simplest way to see if a file exists on the server in JSP?
>
[quoted text clipped - 12 lines]
> Sugapablo
> http://www.sugapablo.net
You might want to try:
if ( new java.io.File("C:\test.txt").exists() ) ...
See also:
http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html
Hope that helps,
Carl.