Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2014 (original work) Open Assessment Technologies SA;
19 *
20 *
21 */
22
23namespace oat\taoMediaManager\model\fileManagement;
24
25use oat\oatbox\filesystem\File;
26use Psr\Http\Message\StreamInterface;
27
28/**
29 * Interface to manage the storage of the taoMediaManager files
30 */
31interface FileManagement
32{
33    public const SERVICE_ID = 'taoMediaManager/fileManager';
34
35    /**
36     * @param string|File $filePath the relative path to the file
37     * @return string a link to the file in order to retrieve it later
38     */
39    public function storeFile($filePath, $label);
40
41    /**
42     * Returns the Size of the file
43     *
44     * @param string $link
45     * @return string size of file in bytes
46     */
47    public function getFileSize($link);
48
49    /**
50     * Returns a stream of the file content
51     *
52     * @param string $link
53     * @return StreamInterface
54     */
55    public function getFileStream($link);
56
57    /**
58     * @param $link
59     * @return boolean if the deletion was successful or not
60     */
61    public function deleteFile($link);
62}