View Javadoc
1   /*
2    * Licensed to The Apereo Foundation under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional
4    * information regarding copyright ownership.
5    *
6    *
7    * The Apereo Foundation licenses this file to you under the Educational
8    * Community License, Version 2.0 (the "License"); you may not use this file
9    * except in compliance with the License. You may obtain a copy of the License
10   * at:
11   *
12   *   http://opensource.org/licenses/ecl2.txt
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   *
20   */
21  
22  package org.opencastproject.publication.youtube;
23  
24  import com.google.api.client.googleapis.media.MediaHttpUploaderProgressListener;
25  
26  import java.io.File;
27  
28  /**
29   * Represents a YouTube video.
30   *
31   * @see com.google.api.services.youtube.model.Video
32   */
33  public class VideoUpload {
34  
35    private final String title;
36    private final String description;
37    private final String privacyStatus;
38    private final File videoFile;
39    private final MediaHttpUploaderProgressListener progressListener;
40    private final String[] tags;
41  
42    /**
43     * @param title may not be {@code null}.
44     * @param description may be {@code null}.
45     * @param privacyStatus may not be {@code null}.
46     * @param videoFile may not be {@code null}.
47     * @param progressListener may be {@code null}.
48     * @param tags may be {@code null}.
49     */
50    public VideoUpload(
51        final String title,
52        final String description,
53        final String privacyStatus,
54        final File videoFile,
55        final MediaHttpUploaderProgressListener progressListener,
56        final String... tags
57    ) {
58      this.title = title;
59      this.description = description;
60      this.privacyStatus = privacyStatus;
61      this.videoFile = videoFile;
62      this.progressListener = progressListener;
63      this.tags = tags;
64    }
65  
66    /**
67     * The video's title.
68     * The value will not be {@code null}.
69     */
70    public String getTitle() {
71      return title;
72    }
73  
74    /**
75     * The video's description.
76     * The value may be {@code null}.
77     */
78    public String getDescription() {
79      return description;
80    }
81  
82    /**
83     * @see com.google.api.services.youtube.model.VideoStatus#setPrivacyStatus(String)
84     * @return will not be {@code null}
85     */
86    public String getPrivacyStatus() {
87      return privacyStatus;
88    }
89  
90    /**
91     * @see com.google.api.services.youtube.model.Video
92     * @return will not be {@code null}
93     */
94    public File getVideoFile() {
95      return videoFile;
96    }
97  
98    /**
99     * Real-time updates of upload status.
100    * @return may be {@code null}
101    */
102   public MediaHttpUploaderProgressListener getProgressListener() {
103     return progressListener;
104   }
105 
106   /**
107    * @see com.google.api.services.youtube.model.VideoSnippet#getTags()
108    * @return may be {@code null}
109    */
110   public String[] getTags() {
111     return tags;
112   }
113 }