org.apache.portals.gems.file
Class FilePortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.apache.portals.bridges.common.GenericServletPortlet
          extended by org.apache.portals.gems.file.FilePortlet
All Implemented Interfaces:
javax.portlet.Portlet, javax.portlet.PortletConfig

public class FilePortlet
extends org.apache.portals.bridges.common.GenericServletPortlet

FilePortlet

Version:
$Id: FilePortlet.java 601037 2007-12-04 18:50:55Z taylor $
Author:
David Sean Taylor

Field Summary
(package private) static int BLOCK_SIZE
           
private  String defaultSourceBasePath
          Default base URL for the source file
private  String defaultSourceFile
          Default URL for the source file
static String PARAM_LOCATION
          Is the file stored in the webapp or outside of the webapp? valid values "webapp" and "filesystem", defaults to webapp
static String PARAM_SOURCE_BASE_PATH
          Name of portlet preference for source file url
static String PARAM_SOURCE_FILE
          Name of portlet preference for source file url
static String PARAM_SOURCE_FILE_PATH
          Name of portlet preference for source file url
static String PARAM_USE_LANGUAGE
           
private  boolean useLanguage
           
private  boolean webappLocation
           
 
Fields inherited from class org.apache.portals.bridges.common.GenericServletPortlet
PARAM_ACTION_PAGE, PARAM_ALLOW_PREFERENCES, PARAM_CUSTOM_PAGE, PARAM_EDIT_PAGE, PARAM_HELP_PAGE, PARAM_MAX_PAGE, PARAM_VIEW_PAGE
 
Constructor Summary
FilePortlet()
           
 
Method Summary
protected static String concatenatePaths(String base, String path)
           
 void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
static void drain(InputStream r, OutputStream w)
           
protected  List fallback(String path, String language)
           
private  String getFilePath(String path)
           
private  javax.servlet.http.HttpServletRequest getHttpServletRequest(javax.portlet.PortletRequest pRequest)
           
private  org.apache.jetspeed.request.RequestContext getRequestContext(javax.portlet.PortletRequest request)
           
 void init(javax.portlet.PortletConfig config)
           
protected  void renderFile(javax.portlet.RenderResponse response, List paths)
           
protected  void setContentType(String path, javax.portlet.RenderResponse response)
           
 
Methods inherited from class org.apache.portals.bridges.common.GenericServletPortlet
doCustom, doEdit, doHelp, getDefaultActionPage, getDefaultCustomPage, getDefaultEditPage, getDefaultHelpPage, getDefaultViewPage, processAction, processPreferencesAction, setDefaultActionPage, setDefaultCustomPage, setDefaultEditPage, setDefaultHelpPage, setDefaultViewPage
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, getInitParameter, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init, render
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_USE_LANGUAGE

public static final String PARAM_USE_LANGUAGE
See Also:
Constant Field Values

PARAM_SOURCE_FILE

public static final String PARAM_SOURCE_FILE
Name of portlet preference for source file url

See Also:
Constant Field Values

PARAM_SOURCE_BASE_PATH

public static final String PARAM_SOURCE_BASE_PATH
Name of portlet preference for source file url

See Also:
Constant Field Values

PARAM_SOURCE_FILE_PATH

public static final String PARAM_SOURCE_FILE_PATH
Name of portlet preference for source file url

See Also:
Constant Field Values

PARAM_LOCATION

public static final String PARAM_LOCATION
Is the file stored in the webapp or outside of the webapp? valid values "webapp" and "filesystem", defaults to webapp

See Also:
Constant Field Values

webappLocation

private boolean webappLocation

defaultSourceFile

private String defaultSourceFile
Default URL for the source file


defaultSourceBasePath

private String defaultSourceBasePath
Default base URL for the source file


useLanguage

private boolean useLanguage

BLOCK_SIZE

static final int BLOCK_SIZE
See Also:
Constant Field Values
Constructor Detail

FilePortlet

public FilePortlet()
Method Detail

init

public void init(javax.portlet.PortletConfig config)
          throws javax.portlet.PortletException
Specified by:
init in interface javax.portlet.Portlet
Overrides:
init in class org.apache.portals.bridges.common.GenericServletPortlet
Throws:
javax.portlet.PortletException

getRequestContext

private org.apache.jetspeed.request.RequestContext getRequestContext(javax.portlet.PortletRequest request)

getHttpServletRequest

private javax.servlet.http.HttpServletRequest getHttpServletRequest(javax.portlet.PortletRequest pRequest)

doView

public void doView(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   IOException
Overrides:
doView in class org.apache.portals.bridges.common.GenericServletPortlet
Throws:
javax.portlet.PortletException
IOException

fallback

protected List fallback(String path,
                        String language)

setContentType

protected void setContentType(String path,
                              javax.portlet.RenderResponse response)

renderFile

protected void renderFile(javax.portlet.RenderResponse response,
                          List paths)
                   throws javax.portlet.PortletException,
                          IOException
Throws:
javax.portlet.PortletException
IOException

drain

public static void drain(InputStream r,
                         OutputStream w)
                  throws IOException
Throws:
IOException

getFilePath

private String getFilePath(String path)

concatenatePaths

protected static String concatenatePaths(String base,
                                         String path)


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.