From 5cae863408630aee768adf70fdb5c11f72b713fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 17 Jun 2014 22:06:56 +0200 Subject: change architecture from inheritance to composition --- lib/public/files/objectstore/iobjectstore.php | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/public/files/objectstore/iobjectstore.php (limited to 'lib/public') diff --git a/lib/public/files/objectstore/iobjectstore.php b/lib/public/files/objectstore/iobjectstore.php new file mode 100644 index 00000000000..ecc35faf34a --- /dev/null +++ b/lib/public/files/objectstore/iobjectstore.php @@ -0,0 +1,32 @@ + Date: Wed, 18 Jun 2014 15:20:26 +0200 Subject: fix rebase, use 'object::user:' or 'object::store: as storage id, by default use container/bucket name for storageid, make storageid configurable, store user only for HomeObjectStoreStorage, change updateObject() to writeObject() --- lib/public/files/objectstore/iobjectstore.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/public') diff --git a/lib/public/files/objectstore/iobjectstore.php b/lib/public/files/objectstore/iobjectstore.php index ecc35faf34a..3b6bd98d338 100644 --- a/lib/public/files/objectstore/iobjectstore.php +++ b/lib/public/files/objectstore/iobjectstore.php @@ -4,6 +4,11 @@ namespace OCP\Files\ObjectStore; interface IObjectStore { + /** + * @return string the container or bucket name where objects are stored + */ + function getStorageId(); + /** * @param string $urn the unified resource name used to identify the object * @param string $tmpFile path to the local temporary file that should be @@ -12,6 +17,7 @@ interface IObjectStore { * @throws Exception when something goes wrong, message will be logged */ function getObject($urn, $tmpFile); + /** * @param string $urn the unified resource name used to identify the object * @param string $tmpFile path to the local temporary file that the object @@ -19,8 +25,7 @@ interface IObjectStore { * @return void * @throws Exception when something goes wrong, message will be logged */ - function updateObject($urn, $tmpFile = null); - + function writeObject($urn, $tmpFile = null); /** * @param string $urn the unified resource name used to identify the object -- cgit v1.2.3 From c112a1d323e363eaf12574bf094a90ce2f89f028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Jun 2014 12:27:47 +0200 Subject: move to stream based IObjectStore interface, rearrange & reformat code --- lib/public/files/objectstore/iobjectstore.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/public') diff --git a/lib/public/files/objectstore/iobjectstore.php b/lib/public/files/objectstore/iobjectstore.php index 3b6bd98d338..b2c5a9da134 100644 --- a/lib/public/files/objectstore/iobjectstore.php +++ b/lib/public/files/objectstore/iobjectstore.php @@ -11,21 +11,17 @@ interface IObjectStore { /** * @param string $urn the unified resource name used to identify the object - * @param string $tmpFile path to the local temporary file that should be - * used to store the object - * @return void + * @return resource stream with the read data * @throws Exception when something goes wrong, message will be logged */ - function getObject($urn, $tmpFile); + function readObject($urn); /** * @param string $urn the unified resource name used to identify the object - * @param string $tmpFile path to the local temporary file that the object - * should be loaded from - * @return void + * @param resource $stream stream with the data to write * @throws Exception when something goes wrong, message will be logged */ - function writeObject($urn, $tmpFile = null); + function writeObject($urn, $stream); /** * @param string $urn the unified resource name used to identify the object -- cgit v1.2.3