|
spring-webmvc-portlet | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.core.io.AbstractResource
org.springframework.core.io.AbstractFileResolvingResource
org.springframework.web.portlet.context.PortletContextResource
public class PortletContextResource
Resource
implementation for
PortletContext
resources, interpreting
relative paths within the portlet application root directory.
Always supports stream access and URL access, but only allows
java.io.File
access when the portlet application archive
is expanded.
PortletContext.getResourceAsStream(java.lang.String)
,
PortletContext.getRealPath(java.lang.String)
Constructor Summary | |
---|---|
PortletContextResource(javax.portlet.PortletContext portletContext,
java.lang.String path)
Create a new PortletContextResource. |
Method Summary | |
---|---|
org.springframework.core.io.Resource |
createRelative(java.lang.String relativePath)
|
boolean |
equals(java.lang.Object obj)
|
boolean |
exists()
This implementation checks PortletContext.getResource . |
java.lang.String |
getDescription()
|
java.io.File |
getFile()
This implementation resolves "file:" URLs or alternatively delegates to PortletContext.getRealPath , throwing a FileNotFoundException
if not found or not resolvable. |
java.lang.String |
getFilename()
|
java.io.InputStream |
getInputStream()
This implementation delegates to PortletContext.getResourceAsStream ,
but throws a FileNotFoundException if not found. |
java.lang.String |
getPath()
Return the path for this resource. |
java.lang.String |
getPathWithinContext()
|
javax.portlet.PortletContext |
getPortletContext()
Return the PortletContext for this resource. |
java.net.URL |
getURL()
This implementation delegates to PortletContext.getResource ,
but throws a FileNotFoundException if no resource found. |
int |
hashCode()
|
boolean |
isReadable()
This implementation delegates to PortletContext.getResourceAsStream ,
which returns null in case of a non-readable resource (e.g. |
Methods inherited from class org.springframework.core.io.AbstractFileResolvingResource |
---|
contentLength, getFile, getFileForLastModifiedCheck, lastModified |
Methods inherited from class org.springframework.core.io.AbstractResource |
---|
getURI, isOpen, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.core.io.Resource |
---|
contentLength, getURI, isOpen, lastModified |
Constructor Detail |
---|
public PortletContextResource(javax.portlet.PortletContext portletContext, java.lang.String path)
The Portlet 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.
portletContext
- the PortletContext to load frompath
- the path of the resourceMethod Detail |
---|
public final javax.portlet.PortletContext getPortletContext()
public final java.lang.String getPath()
public boolean exists()
PortletContext.getResource
.
exists
in interface org.springframework.core.io.Resource
exists
in class org.springframework.core.io.AbstractFileResolvingResource
PortletContext.getResource(String)
public boolean isReadable()
PortletContext.getResourceAsStream
,
which returns null
in case of a non-readable resource (e.g. a directory).
isReadable
in interface org.springframework.core.io.Resource
isReadable
in class org.springframework.core.io.AbstractFileResolvingResource
PortletContext.getResourceAsStream(String)
public java.io.InputStream getInputStream() throws java.io.IOException
PortletContext.getResourceAsStream
,
but throws a FileNotFoundException if not found.
getInputStream
in interface org.springframework.core.io.InputStreamSource
getInputStream
in interface org.springframework.core.io.Resource
java.io.IOException
PortletContext.getResourceAsStream(String)
public java.net.URL getURL() throws java.io.IOException
PortletContext.getResource
,
but throws a FileNotFoundException if no resource found.
getURL
in interface org.springframework.core.io.Resource
getURL
in class org.springframework.core.io.AbstractResource
java.io.IOException
PortletContext.getResource(String)
public java.io.File getFile() throws java.io.IOException
PortletContext.getRealPath
, throwing a FileNotFoundException
if not found or not resolvable.
getFile
in interface org.springframework.core.io.Resource
getFile
in class org.springframework.core.io.AbstractFileResolvingResource
java.io.IOException
PortletContext.getResource(String)
,
PortletContext.getRealPath(String)
public org.springframework.core.io.Resource createRelative(java.lang.String relativePath)
createRelative
in interface org.springframework.core.io.Resource
createRelative
in class org.springframework.core.io.AbstractResource
public java.lang.String getFilename()
getFilename
in interface org.springframework.core.io.Resource
getFilename
in class org.springframework.core.io.AbstractResource
public java.lang.String getDescription()
getDescription
in interface org.springframework.core.io.Resource
public java.lang.String getPathWithinContext()
getPathWithinContext
in interface org.springframework.core.io.ContextResource
public boolean equals(java.lang.Object obj)
equals
in class org.springframework.core.io.AbstractResource
public int hashCode()
hashCode
in class org.springframework.core.io.AbstractResource
|
spring-webmvc-portlet | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |