Top Description Methods
org.springframework.core.io

public Interface ContextResource

extends Resource
Known Direct Implementers
org.springframework.core.io.DefaultResourceLoader.ClassPathContextResource, org.springframework.core.io.FileSystemResourceLoader.FileSystemContextResource, org.springframework.core.io.ClassRelativeResourceLoader.ClassRelativeContextResource

Extended interface for a resource that is loaded from an enclosing 'context', e.g. from a jakarta.servlet.ServletContext but also from plain classpath paths or relative file system paths (specified without an explicit prefix, hence applying relative to the local ResourceLoader's context).
Author
Juergen Hoeller
Since
2.5
See Also
org.springframework.web.context.support.ServletContextResource

Method Summary

Modifier and TypeMethod and Description
public String
getPathWithinContext()

Return the path within the enclosing 'context'.

Inherited from org.springframework.core.io.Resource:
contentLengthcreateRelativeexistsgetContentAsByteArraygetContentAsStringgetDescriptiongetFilegetFilenamegetURIgetURLisFileisOpenisReadablelastModifiedreadableChannel

Method Detail

getPathWithinContextback to summary
public String getPathWithinContext()

Return the path within the enclosing 'context'.

This is typically path relative to a context-specific root directory, e.g. a ServletContext root or a PortletContext root.