From f5c0dbd947d45520550b68dae77a894f871a0758 Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 27 Jul 2011 19:07:28 +0200 Subject: Use autoload --- lib/connector/sabre/file.php | 87 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 lib/connector/sabre/file.php (limited to 'lib/connector/sabre/file.php') diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php new file mode 100644 index 00000000000..fb4e559aa50 --- /dev/null +++ b/lib/connector/sabre/file.php @@ -0,0 +1,87 @@ +path,$data); + + } + + /** + * Returns the data + * + * @return string + */ + public function get() { + + return OC_FILESYSTEM::file_get_contents($this->path); + + } + + /** + * Delete the current file + * + * @return void + */ + public function delete() { + + OC_FILESYSTEM::unlink($this->path); + + } + + /** + * Returns the size of the node, in bytes + * + * @return int + */ + public function getSize() { + + return OC_FILESYSTEM::filesize($this->path); + + } + + /** + * 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 + * + * @return mixed + */ + public function getETag() { + + return null; + + } + + /** + * Returns the mime-type for a file + * + * If null is returned, we'll assume application/octet-stream + * + * @return mixed + */ + public function getContentType() { + + return OC_FILESYSTEM::getMimeType($this->path); + + } +} + -- cgit v1.2.3