From 315344eb9cc58dda23bfe52c1413ad963265a9cb Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 10 Sep 2013 19:34:38 +0200 Subject: move public files api to a clearer namespace --- lib/public/files/file.php | 44 ++++++++++++++++ lib/public/files/folder.php | 104 +++++++++++++++++++++++++++++++++++++ lib/public/files/node.php | 108 +++++++++++++++++++++++++++++++++++++++ lib/public/files/node/file.php | 44 ---------------- lib/public/files/node/folder.php | 104 ------------------------------------- lib/public/files/node/node.php | 108 --------------------------------------- 6 files changed, 256 insertions(+), 256 deletions(-) create mode 100644 lib/public/files/file.php create mode 100644 lib/public/files/folder.php create mode 100644 lib/public/files/node.php delete mode 100644 lib/public/files/node/file.php delete mode 100644 lib/public/files/node/folder.php delete mode 100644 lib/public/files/node/node.php (limited to 'lib') diff --git a/lib/public/files/file.php b/lib/public/files/file.php new file mode 100644 index 00000000000..c571e184cee --- /dev/null +++ b/lib/public/files/file.php @@ -0,0 +1,44 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +use OC\Files\NotPermittedException; + +interface File extends Node { + /** + * @return string + * @throws \OC\Files\NotPermittedException + */ + public function getContent(); + + /** + * @param string $data + * @throws \OC\Files\NotPermittedException + */ + public function putContent($data); + + /** + * @return string + */ + public function getMimeType(); + + /** + * @param string $mode + * @return resource + * @throws \OC\Files\NotPermittedException + */ + public function fopen($mode); + + /** + * @param string $type + * @param bool $raw + * @return string + */ + public function hash($type, $raw = false); +} diff --git a/lib/public/files/folder.php b/lib/public/files/folder.php new file mode 100644 index 00000000000..a8e57f7ae23 --- /dev/null +++ b/lib/public/files/folder.php @@ -0,0 +1,104 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +use OC\Files\Cache\Cache; +use OC\Files\Cache\Scanner; +use OC\Files\NotFoundException; +use OC\Files\NotPermittedException; + +interface Folder extends Node { + /** + * @param string $path path relative to the folder + * @return string + * @throws \OC\Files\NotPermittedException + */ + public function getFullPath($path); + + /** + * @param string $path + * @throws \OC\Files\NotFoundException + * @return string + */ + public function getRelativePath($path); + + /** + * check if a node is a (grand-)child of the folder + * + * @param \OCP\Files\Node $node + * @return bool + */ + public function isSubNode($node); + + /** + * get the content of this directory + * + * @throws \OC\Files\NotFoundException + * @return \OCP\Files\Node[] + */ + public function getDirectoryListing(); + + /** + * Get the node at $path + * + * @param string $path + * @return \OCP\Files\Node + * @throws \OC\Files\NotFoundException + */ + public function get($path); + + /** + * @param string $path + * @return bool + */ + public function nodeExists($path); + + /** + * @param string $path + * @return \OCP\Files\Folder + * @throws NotPermittedException + */ + public function newFolder($path); + + /** + * @param string $path + * @return \OCP\Files\File + * @throws NotPermittedException + */ + public function newFile($path); + + /** + * search for files with the name matching $query + * + * @param string $query + * @return \OCP\Files\Node[] + */ + public function search($query); + + /** + * search for files by mimetype + * + * @param string $mimetype + * @return \OCP\Files\Node[] + */ + public function searchByMime($mimetype); + + /** + * @param $id + * @return \OCP\Files\Node[] + */ + public function getById($id); + + public function getFreeSpace(); + + /** + * @return bool + */ + public function isCreatable(); +} diff --git a/lib/public/files/node.php b/lib/public/files/node.php new file mode 100644 index 00000000000..d3b71803f50 --- /dev/null +++ b/lib/public/files/node.php @@ -0,0 +1,108 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Files; + +interface Node { + /** + * @param string $targetPath + * @throws \OC\Files\NotPermittedException + * @return \OCP\Files\Node + */ + public function move($targetPath); + + public function delete(); + + /** + * @param string $targetPath + * @return \OCP\Files\Node + */ + public function copy($targetPath); + + /** + * @param int $mtime + * @throws \OC\Files\NotPermittedException + */ + public function touch($mtime = null); + + /** + * @return \OC\Files\Storage\Storage + * @throws \OC\Files\NotFoundException + */ + public function getStorage(); + + /** + * @return string + */ + public function getPath(); + + /** + * @return string + */ + public function getInternalPath(); + + /** + * @return int + */ + public function getId(); + + /** + * @return array + */ + public function stat(); + + /** + * @return int + */ + public function getMTime(); + + /** + * @return int + */ + public function getSize(); + + /** + * @return string + */ + public function getEtag(); + + /** + * @return int + */ + public function getPermissions(); + + /** + * @return bool + */ + public function isReadable(); + + /** + * @return bool + */ + public function isUpdateable(); + + /** + * @return bool + */ + public function isDeletable(); + + /** + * @return bool + */ + public function isShareable(); + + /** + * @return Node + */ + public function getParent(); + + /** + * @return string + */ + public function getName(); +} diff --git a/lib/public/files/node/file.php b/lib/public/files/node/file.php deleted file mode 100644 index 193663f60b8..00000000000 --- a/lib/public/files/node/file.php +++ /dev/null @@ -1,44 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace OCP\Files\Node; - -use OC\Files\NotPermittedException; - -interface File extends Node { - /** - * @return string - * @throws \OC\Files\NotPermittedException - */ - public function getContent(); - - /** - * @param string $data - * @throws \OC\Files\NotPermittedException - */ - public function putContent($data); - - /** - * @return string - */ - public function getMimeType(); - - /** - * @param string $mode - * @return resource - * @throws \OC\Files\NotPermittedException - */ - public function fopen($mode); - - /** - * @param string $type - * @param bool $raw - * @return string - */ - public function hash($type, $raw = false); -} diff --git a/lib/public/files/node/folder.php b/lib/public/files/node/folder.php deleted file mode 100644 index af53bc9e584..00000000000 --- a/lib/public/files/node/folder.php +++ /dev/null @@ -1,104 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace OCP\Files\Node; - -use OC\Files\Cache\Cache; -use OC\Files\Cache\Scanner; -use OC\Files\NotFoundException; -use OC\Files\NotPermittedException; - -interface Folder extends Node { - /** - * @param string $path path relative to the folder - * @return string - * @throws \OC\Files\NotPermittedException - */ - public function getFullPath($path); - - /** - * @param string $path - * @throws \OC\Files\NotFoundException - * @return string - */ - public function getRelativePath($path); - - /** - * check if a node is a (grand-)child of the folder - * - * @param \OCP\Files\Node\Node $node - * @return bool - */ - public function isSubNode($node); - - /** - * get the content of this directory - * - * @throws \OC\Files\NotFoundException - * @return \OCP\Files\Node\Node[] - */ - public function getDirectoryListing(); - - /** - * Get the node at $path - * - * @param string $path - * @return \OCP\Files\Node\Node - * @throws \OC\Files\NotFoundException - */ - public function get($path); - - /** - * @param string $path - * @return bool - */ - public function nodeExists($path); - - /** - * @param string $path - * @return \OCP\Files\Node\Folder - * @throws NotPermittedException - */ - public function newFolder($path); - - /** - * @param string $path - * @return \OCP\Files\Node\File - * @throws NotPermittedException - */ - public function newFile($path); - - /** - * search for files with the name matching $query - * - * @param string $query - * @return \OCP\Files\Node\Node[] - */ - public function search($query); - - /** - * search for files by mimetype - * - * @param string $mimetype - * @return \OCP\Files\Node\Node[] - */ - public function searchByMime($mimetype); - - /** - * @param $id - * @return \OCP\Files\Node\Node[] - */ - public function getById($id); - - public function getFreeSpace(); - - /** - * @return bool - */ - public function isCreatable(); -} diff --git a/lib/public/files/node/node.php b/lib/public/files/node/node.php deleted file mode 100644 index b85f37e69a7..00000000000 --- a/lib/public/files/node/node.php +++ /dev/null @@ -1,108 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -namespace OCP\Files\Node; - -interface Node { - /** - * @param string $targetPath - * @throws \OC\Files\NotPermittedException - * @return \OCP\Files\Node\Node - */ - public function move($targetPath); - - public function delete(); - - /** - * @param string $targetPath - * @return \OCP\Files\Node\Node - */ - public function copy($targetPath); - - /** - * @param int $mtime - * @throws \OC\Files\NotPermittedException - */ - public function touch($mtime = null); - - /** - * @return \OC\Files\Storage\Storage - * @throws \OC\Files\NotFoundException - */ - public function getStorage(); - - /** - * @return string - */ - public function getPath(); - - /** - * @return string - */ - public function getInternalPath(); - - /** - * @return int - */ - public function getId(); - - /** - * @return array - */ - public function stat(); - - /** - * @return int - */ - public function getMTime(); - - /** - * @return int - */ - public function getSize(); - - /** - * @return string - */ - public function getEtag(); - - /** - * @return int - */ - public function getPermissions(); - - /** - * @return bool - */ - public function isReadable(); - - /** - * @return bool - */ - public function isUpdateable(); - - /** - * @return bool - */ - public function isDeletable(); - - /** - * @return bool - */ - public function isShareable(); - - /** - * @return Node - */ - public function getParent(); - - /** - * @return string - */ - public function getName(); -} -- cgit v1.2.3