Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairblue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairblue
Commits
27fd9922
Commit
27fd9922
authored
8 years ago
by
Ghazi Triki
Browse files
Options
Downloads
Patches
Plain Diff
Handle non PDF slide conversion for breakout rooms.
parent
886f9617
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bigbluebutton-web/src/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
+32
-11
32 additions, 11 deletions
...uebutton/presentation/PresentationUrlDownloadService.java
with
32 additions
and
11 deletions
bigbluebutton-web/src/java/org/bigbluebutton/presentation/PresentationUrlDownloadService.java
+
32
−
11
View file @
27fd9922
...
...
@@ -49,20 +49,29 @@ public class PresentationUrlDownloadService {
+
File
.
separator
+
presentationId
);
final
String
presentationFilter
=
presentationId
;
FilenameFilter
f
ilter
=
new
FilenameFilter
()
{
FilenameFilter
pdfF
ilter
=
new
FilenameFilter
()
{
public
boolean
accept
(
File
dir
,
String
name
)
{
return
name
.
startsWith
(
presentationFilter
);
return
name
.
startsWith
(
presentationFilter
)
&&
name
.
toLowerCase
().
endsWith
(
"pdf"
);
}
};
File
[]
children
=
sourceMeetingPath
.
listFiles
(
filter
);
File
[]
matches
=
sourceMeetingPath
.
listFiles
(
pdfFilter
);
if
(
matches
.
length
!=
1
)
{
// No PDF presentation was found, we look for an image presentation
FilenameFilter
imgFlter
=
new
FilenameFilter
()
{
public
boolean
accept
(
File
dir
,
String
name
)
{
return
name
.
startsWith
(
presentationFilter
);
}
};
if
(
children
.
length
!=
1
)
{
log
.
error
(
"Not matching file with prefix {} found at {}"
,
matches
=
sourceMeetingPath
.
listFiles
(
imgFlter
);
}
if
(
matches
.
length
!=
1
)
{
log
.
info
(
"Not matching PDF file with prefix {} found at {}"
,
sourceMeetingId
,
sourceMeetingPath
);
return
;
}
else
{
File
sourcePresentationFile
=
children
[
0
];
File
sourcePresentationFile
=
matches
[
0
];
String
filenameExt
=
FilenameUtils
.
getExtension
(
sourcePresentationFile
.
getName
());
String
presId
=
generatePresentationId
(
presentationId
);
...
...
@@ -72,13 +81,25 @@ public class PresentationUrlDownloadService {
presentationDir
,
presId
);
String
newFilePath
=
uploadDir
.
getAbsolutePath
()
+
File
.
separatorChar
+
newFilename
;
File
newPresentation
=
new
File
(
newFilePath
);
pageExtractor
.
extractPage
(
sourcePresentationFile
,
new
File
(
newFilePath
),
presentationSlide
);
if
(
sourcePresentationFile
.
getName
().
toLowerCase
().
endsWith
(
"pdf"
))
{
pageExtractor
.
extractPage
(
sourcePresentationFile
,
new
File
(
newFilePath
),
presentationSlide
);
}
else
{
try
{
FileUtils
.
copyFile
(
sourcePresentationFile
,
newPresentation
);
}
catch
(
IOException
e
)
{
log
.
error
(
"Could not copy presentation {} to {}"
,
sourcePresentationFile
.
getAbsolutePath
(),
newPresentation
.
getAbsolutePath
());
e
.
printStackTrace
();
}
}
File
pres
=
new
File
(
newFilePath
);
processUploadedFile
(
destinationMeetingId
,
presId
,
"default-"
+
presentationSlide
.
toString
()
+
"."
+
filenameExt
,
pres
);
+
presentationSlide
.
toString
()
+
"."
+
filenameExt
,
newPresentation
);
}
}
...
...
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