Class Files

java.lang.Object
org.bgerp.app.servlet.file.Files

public class Files extends Object
Files accessor, allowing to see and remove directory files.
  • Constructor Details

    • Files

      public Files(Class<? extends BaseAction> actionClass, String id, String basedir, Options options, String... wildcards)
      Constructor
      Parameters:
      actionClass - the linked action class
      id - unique ID of the files
      basedir - base dir, only the files there are shown
      options - extended possibilities
      wildcards - wildcards for filtering files, '*' is supported
  • Method Details

    • getId

      public String getId()
      Unique string ID of the files set. Used for generation action names.
      Returns:
    • getOptions

      public Options getOptions()
      Options.
      Returns:
    • getDownloadURL

      public String getDownloadURL()
      File download URL, e.g.: '/admin/app.do?method=downloadLogUpdate'. A name param has to be added at the end.
      Returns:
    • getDownloadPermissionAction

      public String getDownloadPermissionAction()
      File download permission action for checking it using ctxUser.checkPerm().
      Returns:
    • getDeleteURL

      public String getDeleteURL()
      File deletion URL, e.g.: '/admin/app.do?method=deleteLogUpdate'. A name param has to be added at the end.
      Returns:
    • getDeletePermissionAction

      public String getDeletePermissionAction()
      File deletion permission action for checking it using ctxUser.checkPerm().
      Returns:
    • list

      public List<File> list()
      List of files matching
      invalid reference
      #wildcard
      sorted in reversed order by modification time.
      Returns:
    • download

      public org.apache.struts.action.ActionForward download(DynActionForm form) throws BGIllegalArgumentException, IOException, FileNotFoundException
      Send a file content to output stream.
      Parameters:
      form -
      Returns:
      always 'null'.
      Throws:
      BGIllegalArgumentException
      IOException
      FileNotFoundException
    • delete

      public void delete(DynActionForm form)
      Delete file(s).
      Parameters:
      form - form with 'name' parameter values, containing file name.