Class FileDownloadAction

java.lang.Object
org.apache.struts2.showcase.filedownload.FileDownloadAction
All Implemented Interfaces:
Action

public class FileDownloadAction extends Object implements Action
Demonstrates file resource download. Set filePath to the local file resource to download, relative to the application root ("/images/struts.gif").
  • Constructor Details

    • FileDownloadAction

      public FileDownloadAction()
  • Method Details

    • execute

      public String execute() throws Exception
      Description copied from interface: Action
      Where the logic of the action is executed.
      Specified by:
      execute in interface Action
      Returns:
      a string representing the logical result of the execution. See constants in this interface for a list of standard result values.
      Throws:
      Exception - thrown if a system level exception occurs. Note: Application level exceptions should be handled by returning an error value, such as Action.ERROR.
    • setInputPath

      public void setInputPath(String value)
    • getInputStream

      public InputStream getInputStream() throws Exception
      Throws:
      Exception