src/main/java/edu/kit/informatik/pcc/webinterface/datamanagement/VideoDataManager.java
/**
     * Creates a file proxy that will provide the video file to download upon request.
     * Therefore it loads the file from the server.
     *
     * @param videoID Video id of the file to download.
     * @param videoName Video name of the file to download.
     * @return Returns a StreamResources used for the downloader.
     */
Creates a file proxy that will provide the video file to download upon request.
Therefore it loads the file from the server.

@param videoID Video id of the file to download.
@param videoName Video name of the file to download.
@return Returns a StreamResources used for the downloader.
Creates a file proxy that will provide the video file to download upon request . Therefore it loads the file from the server . @param videoID Video id of the file to download . @param videoName Video name of the file to download . @return Returns a StreamResources used for the downloader .
public static StreamResource createDownloadFileProxy(int videoID, String videoName, VaadinSession session) {
        return new StreamResource((StreamResource.StreamSource) () -> {
            Account account = (Account) session.getAttribute(MyUI.SESSION_KEY_ACCOUNT);
            InputStream stream = ServerProxy.videoDownload(videoID, account);
            if (stream == null) {
                MessageBox.createInfo()
                        .withMessage(errors.getString("videoDownloadFail"))
                        .open();
                return null;
            }
            return stream;
        }, videoName + Video.EXTENSION);
    }
public static StreamResource createDownloadFileProxy ( int videoID , String videoName , VaadinSession session ) { return new StreamResource ( ( StreamResource . StreamSource ) ( ) -> { Account account = ( Account ) session . getAttribute ( MyUI . SESSION_KEY_ACCOUNT ) ; InputStream stream = ServerProxy . videoDownload ( videoID , account ) ; if ( stream == null ) { MessageBox . createInfo ( ) . withMessage ( errors . getString ( "videoDownloadFail" ) ) . open ( ) ; return null ; } return stream ; } , videoName + Video . EXTENSION ) ; }
Creates a file proxy that will provide the video file to download upon request.
Creates a file proxy that will provide the video file to download upon request .