Package org.bgerp.app.servlet.file
Class Files
java.lang.Object
org.bgerp.app.servlet.file.Files
Files accessor, allowing to see and remove directory files.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(DynActionForm form) Delete file(s).org.apache.struts.action.ActionForward
download
(DynActionForm form) Send a file content to output stream.File deletion permission action for checking it using ctxUser.checkPerm().File deletion URL, e.g.: '/admin/app.do?action=deleteLogUpdate'.File download permission action for checking it using ctxUser.checkPerm().File download URL, e.g.: '/admin/app.do?action=downloadLogUpdate'.getId()
Unique string ID of the files set.Options.list()
List of files matchinginvalid reference
#wildcard
-
Constructor Details
-
Files
public Files(Class<? extends BaseAction> actionClass, String id, String basedir, Options options, String... wildcards) Constructor- Parameters:
actionClass
- the linked action classid
- unique ID of the filesbasedir
- base dir, only the files there are shownoptions
- extended possibilitieswildcards
- wildcards for filtering files, '*' is supported
-
-
Method Details
-
getId
Unique string ID of the files set. Used for generation action names.- Returns:
-
getOptions
Options.- Returns:
-
getDownloadURL
File download URL, e.g.: '/admin/app.do?action=downloadLogUpdate'. Aname
param has to be added at the end.- Returns:
-
getDownloadPermissionAction
File download permission action for checking it using ctxUser.checkPerm().- Returns:
-
getDeleteURL
File deletion URL, e.g.: '/admin/app.do?action=deleteLogUpdate'. Aname
param has to be added at the end.- Returns:
-
getDeletePermissionAction
File deletion permission action for checking it using ctxUser.checkPerm().- Returns:
-
list
List of files matchinginvalid reference
#wildcard
- 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
Delete file(s).- Parameters:
form
- form with 'name' parameter values, containing file name.
-