Skip to content
Snippets Groups Projects
Commit 3d771ca1 authored by srosse's avatar srosse
Browse files

OO-4699: replace space of video url with %20 for Apache HTTP client

parent 9ba889f7
No related branches found
No related tags found
No related merge requests found
...@@ -297,7 +297,6 @@ public class VideoManagerImpl implements VideoManager { ...@@ -297,7 +297,6 @@ public class VideoManagerImpl implements VideoManager {
// close everything to prevent resource leaks // close everything to prevent resource leaks
frameOutputStream.close(); frameOutputStream.close();
in.close();
return true; return true;
} catch (Exception | AssertionError e) { } catch (Exception | AssertionError e) {
...@@ -348,7 +347,6 @@ public class VideoManagerImpl implements VideoManager { ...@@ -348,7 +347,6 @@ public class VideoManagerImpl implements VideoManager {
} }
// close everything to prevent resource leaks // close everything to prevent resource leaks
frameOutputStream.close(); frameOutputStream.close();
in.close();
return imgBlack; return imgBlack;
} catch (Exception | AssertionError e) { } catch (Exception | AssertionError e) {
...@@ -914,6 +912,9 @@ public class VideoManagerImpl implements VideoManager { ...@@ -914,6 +912,9 @@ public class VideoManagerImpl implements VideoManager {
VFSContainer masterContainer = getMasterContainer(entry.getOlatResource()); VFSContainer masterContainer = getMasterContainer(entry.getOlatResource());
VFSLeaf posterFile = masterContainer.createChildLeaf(FILENAME_POSTER_JPG); VFSLeaf posterFile = masterContainer.createChildLeaf(FILENAME_POSTER_JPG);
if(url.contains(" ")) {
url = url.replace(" ", "%20");
}
HttpGet get = new HttpGet(url); HttpGet get = new HttpGet(url);
get.addHeader("Accept", "image/jpg"); get.addHeader("Accept", "image/jpg");
...@@ -944,6 +945,9 @@ public class VideoManagerImpl implements VideoManager { ...@@ -944,6 +945,9 @@ public class VideoManagerImpl implements VideoManager {
} }
VFSLeaf videoFile = tmpContainer.createChildLeaf(FILENAME_VIDEO_MP4); VFSLeaf videoFile = tmpContainer.createChildLeaf(FILENAME_VIDEO_MP4);
if(url.contains(" ")) {
url = url.replace(" ", "%20");
}
HttpGet get = new HttpGet(url); HttpGet get = new HttpGet(url);
get.addHeader("Accept", "video/mp4"); get.addHeader("Accept", "video/mp4");
...@@ -953,6 +957,8 @@ public class VideoManagerImpl implements VideoManager { ...@@ -953,6 +957,8 @@ public class VideoManagerImpl implements VideoManager {
} catch(Exception e) { } catch(Exception e) {
log.error("", e); log.error("", e);
} }
// make sure that a metadata is created
vfsRepositoryService.getMetadataFor(videoFile);
return videoFile; return videoFile;
} }
...@@ -964,8 +970,6 @@ public class VideoManagerImpl implements VideoManager { ...@@ -964,8 +970,6 @@ public class VideoManagerImpl implements VideoManager {
log.error("", e); log.error("", e);
} }
} }
@Override @Override
public VideoTranscoding updateVideoTranscoding(VideoTranscoding videoTranscoding) { public VideoTranscoding updateVideoTranscoding(VideoTranscoding videoTranscoding) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment