]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/lib/Sabre/DAV/ICollection.php
Merge branch '3.6-release'
[friendica-addons.git] / dav / SabreDAV / lib / Sabre / DAV / ICollection.php
1 <?php
2
3 /**
4  * The ICollection Interface
5  *
6  * This interface should be implemented by each class that represents a collection
7  *
8  * @package Sabre
9  * @subpackage DAV
10  * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
11  * @author Evert Pot (http://www.rooftopsolutions.nl/)
12  * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
13  */
14 interface Sabre_DAV_ICollection extends Sabre_DAV_INode {
15
16     /**
17      * Creates a new file in the directory
18      *
19      * Data will either be supplied as a stream resource, or in certain cases
20      * as a string. Keep in mind that you may have to support either.
21      *
22      * After successful creation of the file, you may choose to return the ETag
23      * of the new file here.
24      *
25      * The returned ETag must be surrounded by double-quotes (The quotes should
26      * be part of the actual string).
27      *
28      * If you cannot accurately determine the ETag, you should not return it.
29      * If you don't store the file exactly as-is (you're transforming it
30      * somehow) you should also not return an ETag.
31      *
32      * This means that if a subsequent GET to this new file does not exactly
33      * return the same contents of what was submitted here, you are strongly
34      * recommended to omit the ETag.
35      *
36      * @param string $name Name of the file
37      * @param resource|string $data Initial payload
38      * @return null|string
39      */
40     function createFile($name, $data = null);
41
42     /**
43      * Creates a new subdirectory
44      *
45      * @param string $name
46      * @return void
47      */
48     function createDirectory($name);
49
50     /**
51      * Returns a specific child node, referenced by its name
52      *
53      * This method must throw Sabre_DAV_Exception_NotFound if the node does not
54      * exist.
55      *
56      * @param string $name
57      * @return Sabre_DAV_INode
58      */
59     function getChild($name);
60
61     /**
62      * Returns an array with all the child nodes
63      *
64      * @return Sabre_DAV_INode[]
65      */
66     function getChildren();
67
68     /**
69      * Checks if a child-node with the specified name exists
70      *
71      * @param string $name
72      * @return bool
73      */
74     function childExists($name);
75
76 }
77