]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/lib/Sabre/DAV/IFile.php
Merge branch 'master' of git://github.com/friendica/friendica-addons
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / DAV / IFile.php
1 <?php
2
3 /**
4  * This interface represents a file in the directory tree
5  *
6  * A file is a bit of a broad definition. In general it implies that on
7  * this specific node a PUT or GET method may be performed, to either update,
8  * or retrieve the contents of the file.
9  *
10  * @package Sabre
11  * @subpackage DAV
12  * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
13  * @author Evert Pot (http://www.rooftopsolutions.nl/)
14  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
15  */
16 interface Sabre_DAV_IFile extends Sabre_DAV_INode {
17
18     /**
19      * Updates the data
20      *
21      * The data argument is a readable stream resource.
22      *
23      * After a succesful put operation, you may choose to return an ETag. The
24      * etag must always be surrounded by double-quotes. These quotes must
25      * appear in the actual string you're returning.
26      *
27      * Clients may use the ETag from a PUT request to later on make sure that
28      * when they update the file, the contents haven't changed in the mean
29      * time.
30      *
31      * If you don't plan to store the file byte-by-byte, and you return a
32      * different object on a subsequent GET you are strongly recommended to not
33      * return an ETag, and just return null.
34      *
35      * @param resource $data
36      * @return string|null
37      */
38     function put($data);
39
40     /**
41      * Returns the data
42      *
43      * This method may either return a string or a readable stream resource
44      *
45      * @return mixed
46      */
47     function get();
48
49     /**
50      * Returns the mime-type for a file
51      *
52      * If null is returned, we'll assume application/octet-stream
53      *
54      * @return string|null
55      */
56     function getContentType();
57
58     /**
59      * Returns the ETag for a file
60      *
61      * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
62      *
63      * Return null if the ETag can not effectively be determined
64      *
65      * @return void
66      */
67     function getETag();
68
69     /**
70      * Returns the size of the node, in bytes
71      *
72      * @return int
73      */
74     function getSize();
75
76 }
77