]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/lib/Sabre/DAV/FS/File.php
removed community home addon
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / DAV / FS / File.php
1 <?php
2
3 /**
4  * File class
5  *
6  * @package Sabre
7  * @subpackage DAV
8  * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
9  * @author Evert Pot (http://www.rooftopsolutions.nl/)
10  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
11  */
12 class Sabre_DAV_FS_File extends Sabre_DAV_FS_Node implements Sabre_DAV_IFile {
13
14     /**
15      * Updates the data
16      *
17      * @param resource $data
18      * @return void
19      */
20     public function put($data) {
21
22         file_put_contents($this->path,$data);
23
24     }
25
26     /**
27      * Returns the data
28      *
29      * @return string
30      */
31     public function get() {
32
33         return fopen($this->path,'r');
34
35     }
36
37     /**
38      * Delete the current file
39      *
40      * @return void
41      */
42     public function delete() {
43
44         unlink($this->path);
45
46     }
47
48     /**
49      * Returns the size of the node, in bytes
50      *
51      * @return int
52      */
53     public function getSize() {
54
55         return filesize($this->path);
56
57     }
58
59     /**
60      * Returns the ETag for a file
61      *
62      * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
63      * The ETag is an arbitrary string, but MUST be surrounded by double-quotes.
64      *
65      * Return null if the ETag can not effectively be determined
66      *
67      * @return mixed
68      */
69     public function getETag() {
70
71         return null;
72
73     }
74
75     /**
76      * Returns the mime-type for a file
77      *
78      * If null is returned, we'll assume application/octet-stream
79      *
80      * @return mixed
81      */
82     public function getContentType() {
83
84         return null;
85
86     }
87
88 }
89