Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
8767c029
Commit
8767c029
authored
10 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-1498: check if the file exists before starting the download
parent
6b1a60e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/modules/dialog/DialogElementsController.java
+10
-7
10 additions, 7 deletions
...ava/org/olat/modules/dialog/DialogElementsController.java
with
10 additions
and
7 deletions
src/main/java/org/olat/modules/dialog/DialogElementsController.java
+
10
−
7
View file @
8767c029
...
@@ -68,6 +68,7 @@ import org.olat.core.util.Util;
...
@@ -68,6 +68,7 @@ import org.olat.core.util.Util;
import
org.olat.core.util.resource.OresHelper
;
import
org.olat.core.util.resource.OresHelper
;
import
org.olat.core.util.vfs.Quota
;
import
org.olat.core.util.vfs.Quota
;
import
org.olat.core.util.vfs.VFSContainer
;
import
org.olat.core.util.vfs.VFSContainer
;
import
org.olat.core.util.vfs.VFSItem
;
import
org.olat.core.util.vfs.VFSLeaf
;
import
org.olat.core.util.vfs.VFSLeaf
;
import
org.olat.core.util.vfs.VFSManager
;
import
org.olat.core.util.vfs.VFSManager
;
import
org.olat.core.util.vfs.VFSMediaResource
;
import
org.olat.core.util.vfs.VFSMediaResource
;
...
@@ -385,13 +386,15 @@ public class DialogElementsController extends BasicController {
...
@@ -385,13 +386,15 @@ public class DialogElementsController extends BasicController {
*/
*/
private
void
doFileDelivery
(
UserRequest
ureq
,
Long
forumKey
)
{
private
void
doFileDelivery
(
UserRequest
ureq
,
Long
forumKey
)
{
OlatRootFolderImpl
forumContainer
=
getForumContainer
(
forumKey
);
OlatRootFolderImpl
forumContainer
=
getForumContainer
(
forumKey
);
VFSLeaf
vl
=
(
VFSLeaf
)
forumContainer
.
getItems
(
new
VFSLeafFilter
()).
get
(
0
);
List
<
VFSItem
>
items
=
forumContainer
.
getItems
(
new
VFSLeafFilter
());
if
(
items
.
size
()
>
0
&&
items
.
get
(
0
)
instanceof
VFSLeaf
)
{
//ureq.getDispatchResult().setResultingMediaResource(new FileDialogMediaResource(vl));
VFSLeaf
vl
=
(
VFSLeaf
)
items
.
get
(
0
);
ureq
.
getDispatchResult
().
setResultingMediaResource
(
new
VFSMediaResource
(
vl
));
ureq
.
getDispatchResult
().
setResultingMediaResource
(
new
VFSMediaResource
(
vl
));
// do logging
ThreadLocalUserActivityLogger
.
log
(
CourseLoggingAction
.
DIALOG_ELEMENT_FILE_DOWNLOADED
,
getClass
(),
ThreadLocalUserActivityLogger
.
log
(
CourseLoggingAction
.
DIALOG_ELEMENT_FILE_DOWNLOADED
,
getClass
(),
LoggingResourceable
.
wrapBCFile
(
vl
.
getName
()));
LoggingResourceable
.
wrapBCFile
(
vl
.
getName
()));
}
else
{
logError
(
"No file to discuss: "
+
forumContainer
,
null
);
}
}
}
public
void
event
(
UserRequest
ureq
,
Component
source
,
Event
event
)
{
public
void
event
(
UserRequest
ureq
,
Component
source
,
Event
event
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment