SRV.5.5 Path Translation MethodsThere are two convenience methods in the HttpServletRequest interface which allow the developer to obtain the file system path equivalent to a particular path. These methods are:
The getRealPath method takes a String argument and returns a String representation of a file on the local file system to which that path corresponds. The get PathTranslated method computes the real path of the pathInfo of this request. In situations where the servlet container cannot determine a valid file path for these methods, such as when the web application is executed from an archive, on a remote file system not accessible locally, or in a database, these methods must return null. |