From 2086bc4be77ba64337b721cec1cac544c1c58452 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 29 Sep 2011 14:28:57 +0200 Subject: update sabredav to 1.5.3 --- 3rdparty/Sabre/DAV/SimpleFile.php | 120 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 3rdparty/Sabre/DAV/SimpleFile.php (limited to '3rdparty/Sabre/DAV/SimpleFile.php') diff --git a/3rdparty/Sabre/DAV/SimpleFile.php b/3rdparty/Sabre/DAV/SimpleFile.php new file mode 100644 index 00000000000..304dff1c5ec --- /dev/null +++ b/3rdparty/Sabre/DAV/SimpleFile.php @@ -0,0 +1,120 @@ +name = $name; + $this->contents = $contents; + $this->mimeType = $mimeType; + + } + + /** + * Returns the node name for this file. + * + * This name is used to construct the url. + * + * @return string + */ + public function getName() { + + return $this->name; + + } + + /** + * Returns the data + * + * This method may either return a string or a readable stream resource + * + * @return mixed + */ + public function get() { + + return $this->contents; + + } + + /** + * Returns the size of the file, in bytes. + * + * @return int + */ + public function getSize() { + + return strlen($this->contents); + + } + + /** + * Returns the ETag for a file + * + * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. + * The ETag is an arbritrary string, but MUST be surrounded by double-quotes. + * + * Return null if the ETag can not effectively be determined + */ + public function getETag() { + + return '"' . md5($this->contents) . '"'; + + } + + /** + * Returns the mime-type for a file + * + * If null is returned, we'll assume application/octet-stream + */ + public function getContentType() { + + return $this->mimeType; + + } + +} + +?> -- cgit v1.2.3