public class MockPortletContext extends Object implements PortletContext
PortletContext interface.| Constructor and Description |
|---|
MockPortletContext()
Create a new MockPortletContext with no base path and a
DefaultResourceLoader (i.e.
|
MockPortletContext(org.springframework.core.io.ResourceLoader resourceLoader)
Create a new MockPortletContext, using the specified ResourceLoader
and no base path.
|
MockPortletContext(String resourceBasePath)
Create a new MockPortletContext using a DefaultResourceLoader.
|
MockPortletContext(String resourceBasePath,
org.springframework.core.io.ResourceLoader resourceLoader)
Create a new MockPortletContext.
|
public MockPortletContext()
DefaultResourceLoaderpublic MockPortletContext(String resourceBasePath)
resourceBasePath - the WAR root directory (should not end with a slash)DefaultResourceLoaderpublic MockPortletContext(org.springframework.core.io.ResourceLoader resourceLoader)
resourceLoader - the ResourceLoader to use (or null for the default)public MockPortletContext(String resourceBasePath, org.springframework.core.io.ResourceLoader resourceLoader)
resourceBasePath - the WAR root directory (should not end with a slash)resourceLoader - the ResourceLoader to use (or null for the default)protected String getResourceLocation(String path)
path - the path as specifiedpublic String getServerInfo()
getServerInfo in interface PortletContextpublic PortletRequestDispatcher getRequestDispatcher(String path)
getRequestDispatcher in interface PortletContextpublic PortletRequestDispatcher getNamedDispatcher(String path)
getNamedDispatcher in interface PortletContextpublic InputStream getResourceAsStream(String path)
getResourceAsStream in interface PortletContextpublic int getMajorVersion()
getMajorVersion in interface PortletContextpublic int getMinorVersion()
getMinorVersion in interface PortletContextpublic String getMimeType(String filePath)
getMimeType in interface PortletContextpublic String getRealPath(String path)
getRealPath in interface PortletContextpublic Set<String> getResourcePaths(String path)
getResourcePaths in interface PortletContextpublic URL getResource(String path) throws MalformedURLException
getResource in interface PortletContextMalformedURLExceptionpublic Object getAttribute(String name)
getAttribute in interface PortletContextpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface PortletContextpublic void setAttribute(String name, Object value)
setAttribute in interface PortletContextpublic void removeAttribute(String name)
removeAttribute in interface PortletContextpublic String getInitParameter(String name)
getInitParameter in interface PortletContextpublic Enumeration<String> getInitParameterNames()
getInitParameterNames in interface PortletContextpublic void log(String message)
log in interface PortletContextpublic void log(String message, Throwable t)
log in interface PortletContextpublic void setPortletContextName(String portletContextName)
public String getPortletContextName()
getPortletContextName in interface PortletContextpublic void addContainerRuntimeOption(String key)
public Enumeration<String> getContainerRuntimeOptions()
getContainerRuntimeOptions in interface PortletContext