> From: Ivan [mailto:xhh...@gmail.com]
> Subject: Re: FileDirContext returns the path directly without checking
> whether the target file really exists
> 
> I copied some words from the spec, the the second paragraph, 
> it says something about resources in the META-INF/resources 
> directory, if we do not need to care about whether the real
> file exists, I think we could never go into this situation,
> we might always have a path in the default context.
> right ?

No.  The resource may or may not exist completely independently of whether or 
not the webapp has some location in the file system; you're confusing the 
situations.  One can use getRealPath() to determine the path for a resource the 
webapp wants to /create/, not just one the webapp wants to read.  If you want 
to see if the path returned points to an existing file, there are ample APIs in 
the JRE to let you do so.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to