Class Files
java.lang.Object
org.bgerp.app.servlet.file.Files
Files accessor, allowing to see and remove directory files
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondelete(DynActionForm form) Delete file(s)org.apache.struts.action.ActionForwarddownload(DynActionForm form) Sends a file content to response output streamgetId()highlight(DynActionForm form) Set a file highlight classes to a responselist()longCalculates total size of provided files.
-
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
- Returns:
- unique string ID of the files set, used for generation action names
-
getOptions
- Returns:
- the options
-
getDownloadPermissionAction
- Returns:
- file download permission action for checking it using ctxUser.checkPerm()
-
getDownloadURL
- Returns:
- file download URL, e.g.: '/admin/app.do?method=downloadLogUpdate'.
A
nameparam has to be added at the end.
-
getHighlightPermissionAction
-
getHighlightURL
-
getDeletePermissionAction
- Returns:
- file deletion permission action for checking it using ctxUser.checkPerm()
-
getDeleteURL
- Returns:
- file deletion URL, e.g.: '/admin/app.do?method=deleteLogUpdate'.
A
nameparam has to be added at the end.
-
list
- Returns:
- list of files matching
fileFiltersorted accordinglyOptions.getOrder()
-
size
-
download
public org.apache.struts.action.ActionForward download(DynActionForm form) throws BGIllegalArgumentException, IOException, FileNotFoundException Sends a file content to response output stream- Parameters:
form- request form with file name in paramname- Returns:
- always
null - Throws:
BGIllegalArgumentExceptionIOExceptionFileNotFoundException
-
highlight
public DynActionForm highlight(DynActionForm form) throws BGIllegalArgumentException, FileNotFoundException Set a file highlight classes to a response- Parameters:
form- the request form with the file name in paramname- Returns:
- the
form - Throws:
BGIllegalArgumentExceptionFileNotFoundException
-
delete
Delete file(s)- Parameters:
form- form withnameparameter values, containing the file name(s)- Returns:
- the
form - Throws:
FileNotFoundException
-