4 * This interface represents a file in the directory tree
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.
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
16 interface Sabre_DAV_IFile extends Sabre_DAV_INode {
21 * The data argument is a readable stream resource.
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.
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
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.
35 * @param resource $data
43 * This method may either return a string or a readable stream resource
50 * Returns the mime-type for a file
52 * If null is returned, we'll assume application/octet-stream
56 function getContentType();
59 * Returns the ETag for a file
61 * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change.
63 * Return null if the ETag can not effectively be determined
70 * Returns the size of the node, in bytes