namespace OC\Files\Node;
-use OC\Files\NotPermittedException;
+use OCP\Files\NotPermittedException;
-class File extends Node implements \OCP\Files\Node\File {
+class File extends Node implements \OCP\Files\File {
/**
* @return string
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
*/
public function getContent() {
if ($this->checkPermissions(\OCP\PERMISSION_READ)) {
/**
* @param string $data
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
*/
public function putContent($data) {
if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) {
/**
* @param string $mode
* @return resource
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
*/
public function fopen($mode) {
$preHooks = array();
/**
* @param string $targetPath
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
* @return \OC\Files\Node\Node
*/
public function copy($targetPath) {
/**
* @param string $targetPath
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
* @return \OC\Files\Node\Node
*/
public function move($targetPath) {
use OC\Files\Cache\Cache;
use OC\Files\Cache\Scanner;
-use OC\Files\NotFoundException;
-use OC\Files\NotPermittedException;
+use OCP\Files\NotFoundException;
+use OCP\Files\NotPermittedException;
-class Folder extends Node implements \OCP\Files\Node\Folder {
+class Folder extends Node implements \OCP\Files\Folder {
/**
* @param string $path path relative to the folder
* @return string
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
*/
public function getFullPath($path) {
if (!$this->isValidPath($path)) {
/**
* @param string $path
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
* @return string
*/
public function getRelativePath($path) {
/**
* get the content of this directory
*
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
* @return Node[]
*/
public function getDirectoryListing() {
*
* @param string $path
* @return \OC\Files\Node\Node
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
*/
public function get($path) {
return $this->root->get($this->getFullPath($path));
/**
* @param string $path
- * @return Folder
- * @throws NotPermittedException
+ * @return \OC\Files\Node\Folder
+ * @throws \OCP\Files\NotPermittedException
*/
public function newFolder($path) {
if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) {
/**
* @param string $path
- * @return File
- * @throws NotPermittedException
+ * @return \OC\Files\Node\File
+ * @throws \OCP\Files\NotPermittedException
*/
public function newFile($path) {
if ($this->checkPermissions(\OCP\PERMISSION_CREATE)) {
* search for files with the name matching $query
*
* @param string $query
- * @return Node[]
+ * @return \OC\Files\Node\Node[]
*/
public function search($query) {
return $this->searchCommon('%' . $query . '%', 'search');
/**
* @param string $query
* @param string $method
- * @return Node[]
+ * @return \OC\Files\Node\Node[]
*/
private function searchCommon($query, $method) {
$files = array();
/**
* @param $id
- * @return Node[]
+ * @return \OC\Files\Node\Node[]
*/
public function getById($id) {
$nodes = $this->root->getById($id);
/**
* @param string $targetPath
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
* @return \OC\Files\Node\Node
*/
public function copy($targetPath) {
/**
* @param string $targetPath
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
* @return \OC\Files\Node\Node
*/
public function move($targetPath) {
use OC\Files\Cache\Cache;
use OC\Files\Cache\Scanner;
-use OC\Files\NotFoundException;
-use OC\Files\NotPermittedException;
+use OCP\Files\NotFoundException;
+use OCP\Files\NotPermittedException;
-require_once 'files/exceptions.php';
-
-class Node implements \OCP\Files\Node\Node {
+class Node implements \OCP\Files\Node {
/**
* @var \OC\Files\View $view
*/
/**
* @param string $targetPath
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
* @return \OC\Files\Node\Node
*/
public function move($targetPath) {
/**
* @param int $mtime
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
*/
public function touch($mtime = null) {
if ($this->checkPermissions(\OCP\PERMISSION_UPDATE)) {
/**
* @return \OC\Files\Storage\Storage
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
*/
public function getStorage() {
list($storage,) = $this->view->resolvePath($this->path);
namespace OC\Files\Node;
-use OC\Files\NotFoundException;
+use OCP\Files\NotFoundException;
class NonExistingFile extends File {
/**
* @param string $newPath
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
*/
public function rename($newPath) {
throw new NotFoundException();
namespace OC\Files\Node;
-use OC\Files\NotFoundException;
+use OCP\Files\NotFoundException;
class NonExistingFolder extends Folder {
/**
* @param string $newPath
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
*/
public function rename($newPath) {
throw new NotFoundException();
use OC\Files\Cache\Scanner;
use OC\Files\Mount\Manager;
use OC\Files\Mount\Mount;
-use OC\Files\NotFoundException;
-use OC\Files\NotPermittedException;
+use OCP\Files\NotFoundException;
+use OCP\Files\NotPermittedException;
use OC\Hooks\Emitter;
use OC\Hooks\PublicEmitter;
* Class Root
*
* Hooks available in scope \OC\Files
- * - preWrite(\OC\Files\Node\Node $node)
- * - postWrite(\OC\Files\Node\Node $node)
- * - preCreate(\OC\Files\Node\Node $node)
- * - postCreate(\OC\Files\Node\Node $node)
- * - preDelete(\OC\Files\Node\Node $node)
- * - postDelete(\OC\Files\Node\Node $node)
- * - preTouch(\OC\Files\Node\Node $node, int $mtime)
- * - postTouch(\OC\Files\Node\Node $node)
- * - preCopy(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target)
- * - postCopy(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target)
- * - preRename(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target)
- * - postRename(\OC\Files\Node\Node $source, \OC\Files\Node\Node $target)
+ * - preWrite(\OCP\Files\Node $node)
+ * - postWrite(\OCP\Files\Node $node)
+ * - preCreate(\OCP\Files\Node $node)
+ * - postCreate(\OCP\Files\Node $node)
+ * - preDelete(\OCP\Files\Node $node)
+ * - postDelete(\OCP\Files\Node $node)
+ * - preTouch(\OC\FilesP\Node $node, int $mtime)
+ * - postTouch(\OCP\Files\Node $node)
+ * - preCopy(\OCP\Files\Node $source, \OCP\Files\Node $target)
+ * - postCopy(\OCP\Files\Node $source, \OCP\Files\Node $target)
+ * - preRename(\OCP\Files\Node $source, \OCP\Files\Node $target)
+ * - postRename(\OCP\Files\Node $source, \OCP\Files\Node $target)
*
* @package OC\Files\Node
*/
/**
* @param string $path
- * @throws \OC\Files\NotFoundException
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotFoundException
+ * @throws \OCP\Files\NotPermittedException
* @return Node
*/
public function get($path) {
* can exist in different places
*
* @param int $id
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
* @return Node[]
*/
public function getById($id) {
/**
* @param string $targetPath
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
* @return \OC\Files\Node\Node
*/
public function rename($targetPath) {
/**
* @param string $targetPath
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
* @return \OC\Files\Node\Node
*/
public function copy($targetPath) {
/**
* @param int $mtime
- * @throws \OC\Files\NotPermittedException
+ * @throws \OCP\Files\NotPermittedException
*/
public function touch($mtime = null) {
throw new NotPermittedException();
/**
* @return \OC\Files\Storage\Storage
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
*/
public function getStorage() {
throw new NotFoundException();
/**
* @return Node
- * @throws \OC\Files\NotFoundException
+ * @throws \OCP\Files\NotFoundException
*/
public function getParent() {
throw new NotFoundException();
--- /dev/null
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCP\Files;
+
+class AlreadyExistsException extends \Exception {}
--- /dev/null
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCP\Files;
+
+class NotEnoughSpaceException extends \Exception {}
--- /dev/null
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCP\Files;
+
+class NotFoundException extends \Exception {}
--- /dev/null
+<?php
+/**
+ * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCP\Files;
+
+class NotPermittedException extends \Exception {}