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
static java.lang.String PARAM_LOCATION
          Is the file stored in the webapp or outside of the webapp? valid values "webapp" and "filesystem", defaults to webapp
static java.lang.String PARAM_SOURCE_BASE_PATH
          Name of portlet preference for source file url
static java.lang.String PARAM_SOURCE_FILE
          Name of portlet preference for source file url
static java.lang.String PARAM_SOURCE_FILE_PATH
          Name of portlet preference for source file url
static java.lang.String PARAM_USE_LANGUAGE
           
 
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 java.lang.String concatenatePaths(java.lang.String base, java.lang.String path)
           
 void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
static void drain(java.io.InputStream r, java.io.OutputStream w)
           
protected  java.util.List fallback(java.lang.String path, java.lang.String language)
           
 void init(javax.portlet.PortletConfig config)
           
protected  void renderFile(javax.portlet.RenderResponse response, java.util.List paths)
           
protected  void setContentType(java.lang.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 java.lang.String PARAM_USE_LANGUAGE
See Also:
Constant Field Values

PARAM_SOURCE_FILE

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

See Also:
Constant Field Values

PARAM_SOURCE_BASE_PATH

public static final java.lang.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 java.lang.String PARAM_SOURCE_FILE_PATH
Name of portlet preference for source file url

See Also:
Constant Field Values

PARAM_LOCATION

public static final java.lang.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
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

doView

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

fallback

protected java.util.List fallback(java.lang.String path,
                                  java.lang.String language)

setContentType

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

renderFile

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

drain

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

concatenatePaths

protected static java.lang.String concatenatePaths(java.lang.String base,
                                                   java.lang.String path)


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