open class ServletContextResource : AbstractFileResolvingResource, ContextResource
org.springframework.core.io.Resource implementation for javax.servlet.ServletContext resources, interpreting relative paths within the web application root directory.
Always supports stream access and URL access, but only allows java.io.File access when the web application archive is expanded.
Author
Juergen Hoeller
Since
28.12.2003
See Also
javax.servlet.ServletContext#getResourceAsStreamjavax.servlet.ServletContext#getResourcejavax.servlet.ServletContext#getRealPath
ServletContextResource(servletContext: ServletContext, path: String)
Create a new ServletContextResource. The Servlet spec requires that resource paths start with a slash, even if many containers accept paths without leading slash too. Consequently, the given path will be prepended with a slash if it doesn't already start with one. |
open fun createRelative(relativePath: String): Resource
This implementation creates a ServletContextResource, applying the given path relative to the path of the underlying file of this resource descriptor. |
|
open fun equals(other: Any?): Boolean
This implementation compares the underlying ServletContext resource locations. |
|
open fun exists(): Boolean
This implementation checks |
|
open fun getDescription(): String
This implementation returns a description that includes the ServletContext resource location. |
|
open fun getFile(): File
This implementation resolves "file:" URLs or alternatively delegates to |
|
open fun getFilename(): String
This implementation returns the name of the file that this ServletContext resource refers to. |
|
open fun getInputStream(): InputStream
This implementation delegates to |
|
fun getPath(): String
Return the path for this resource. |
|
open fun getPathWithinContext(): String |
|
fun getServletContext(): ServletContext
Return the ServletContext for this resource. |
|
open fun getURL(): URL
This implementation delegates to |
|
open fun hashCode(): Int
This implementation returns the hash code of the underlying ServletContext resource location. |
|
open fun isFile(): Boolean |
|
open fun isReadable(): Boolean
This implementation delegates to |