]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/lib/Sabre/DAV/File.php
Merge branch 'master' of git://github.com/friendica/friendica-addons
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / DAV / File.php
1 <?php
2
3 /**
4  * File class
5  *
6  * This is a helper class, that should aid in getting file classes setup.
7  * Most of its methods are implemented, and throw permission denied exceptions
8  *
9  * @package Sabre
10  * @subpackage DAV
11  * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
12  * @author Evert Pot (http://www.rooftopsolutions.nl/)
13  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
14  */
15 abstract class Sabre_DAV_File extends Sabre_DAV_Node implements Sabre_DAV_IFile {
16
17     /**
18      * Updates the data
19      *
20      * data is a readable stream resource.
21      *
22      * @param resource $data
23      * @return void
24      */
25     public function put($data) {
26
27         throw new Sabre_DAV_Exception_Forbidden('Permission denied to change data');
28
29     }
30
31     /**
32      * Returns the data
33      *
34      * This method may either return a string or a readable stream resource
35      *
36      * @return mixed
37      */
38     public function get() {
39
40         throw new Sabre_DAV_Exception_Forbidden('Permission denied to read this file');
41
42     }
43
44     /**
45      * Returns the size of the file, in bytes.
46      *
47      * @return int
48      */
49     public function getSize() {
50
51         return 0;
52
53     }
54
55     /**
56      * Returns the ETag for a file
57      *
58      * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
59      * The ETag is an arbitrary string, but MUST be surrounded by double-quotes.
60      *
61      * Return null if the ETag can not effectively be determined
62      *
63      * @return string|null
64      */
65     public function getETag() {
66
67         return null;
68
69     }
70
71     /**
72      * Returns the mime-type for a file
73      *
74      * If null is returned, we'll assume application/octet-stream
75      *
76      * @return string|null
77      */
78     public function getContentType() {
79
80         return null;
81
82     }
83
84 }
85