Skip to content

Package: VimeoMediaServerService

VimeoMediaServerService

nameinstructionbranchcomplexitylinemethod
VimeoMediaServerService()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
childrenFactory(MediaFolder)
M: 26 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createRootFolder(MediaFolder)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * *********************************************************************************************************************
3: *
4: * blueMarine II: Semantic Media Centre
5: * http://tidalwave.it/projects/bluemarine2
6: *
7: * Copyright (C) 2015 - 2021 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *********************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
12: * the License. You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
17: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations under the License.
19: *
20: * *********************************************************************************************************************
21: *
22: * git clone https://bitbucket.org/tidalwave/bluemarine2-src
23: * git clone https://github.com/tidalwave-it/bluemarine2-src
24: *
25: * *********************************************************************************************************************
26: */
27: package it.tidalwave.bluemarine2.service.vimeo.impl;
28:
29: import javax.annotation.Nonnull;
30: import java.util.Arrays;
31: import java.util.Collection;
32: import java.nio.file.Path;
33: import java.nio.file.Paths;
34: import it.tidalwave.bluemarine2.model.MediaFolder;
35: import it.tidalwave.bluemarine2.model.VirtualMediaFolder;
36: import it.tidalwave.bluemarine2.model.spi.PathAwareEntity;
37: import it.tidalwave.bluemarine2.mediaserver.spi.MediaServerService;
38:
39: /***********************************************************************************************************************
40: *
41: * @author Fabrizio Giudici
42: * @version $Id$
43: *
44: **********************************************************************************************************************/
45: public class VimeoMediaServerService implements MediaServerService
46: {
47: private static final Path PATH_ROOT = Paths.get("vimeo");
48:
49: @Override @Nonnull
50: public MediaFolder createRootFolder (final @Nonnull MediaFolder parent)
51: {
52: return new VirtualMediaFolder(parent, PATH_ROOT, "Vimeo", this::childrenFactory);
53: }
54:
55: @Nonnull
56: private Collection<PathAwareEntity> childrenFactory (final @Nonnull MediaFolder parent)
57: {
58: return Arrays.asList(
59: new VideoMediaItem(parent, "id1", "mp4", "video/mp4", "http://stoppingdown.net/media/movies/20071209-0076/800/movie.mp4"),
60: new VideoMediaItem(parent, "id2", "mkv", "video/mkv", "http://trailers.divx.com/divx_prod/profiles/WiegelesHeliSki_DivXPlus_19Mbps.mkv"));
61:
62:
63:
64: // return Arrays.asList(new VirtualMediaFolder(parent, PATH_DIARY, "Diary", diaryProvider::findPhotos),
65: // new VirtualMediaFolder(parent, PATH_THEMES, "Themes", themesProvider::findPhotos));
66: }
67: }