2013-09-06 22:38:59 +04:00
|
|
|
<?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.
|
|
|
|
*/
|
|
|
|
|
2013-09-10 21:34:38 +04:00
|
|
|
namespace OCP\Files;
|
2013-09-06 22:38:59 +04:00
|
|
|
|
|
|
|
interface Folder extends Node {
|
|
|
|
/**
|
2013-09-10 22:02:15 +04:00
|
|
|
* Get the full path of an item in the folder within owncloud's filesystem
|
|
|
|
*
|
|
|
|
* @param string $path relative path of an item in the folder
|
2013-09-06 22:38:59 +04:00
|
|
|
* @return string
|
2013-09-10 22:02:15 +04:00
|
|
|
* @throws \OCP\Files\NotPermittedException
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function getFullPath($path);
|
|
|
|
|
|
|
|
/**
|
2013-09-10 22:02:15 +04:00
|
|
|
* Get the path of an item in the folder relative to the folder
|
|
|
|
*
|
|
|
|
* @param string $path absolute path of an item in the folder
|
|
|
|
* @throws \OCP\Files\NotFoundException
|
2013-09-06 22:38:59 +04:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getRelativePath($path);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* check if a node is a (grand-)child of the folder
|
|
|
|
*
|
2013-09-10 21:34:38 +04:00
|
|
|
* @param \OCP\Files\Node $node
|
2013-09-06 22:38:59 +04:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isSubNode($node);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get the content of this directory
|
|
|
|
*
|
2013-09-10 22:02:15 +04:00
|
|
|
* @throws \OCP\Files\NotFoundException
|
2013-09-10 21:34:38 +04:00
|
|
|
* @return \OCP\Files\Node[]
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function getDirectoryListing();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the node at $path
|
|
|
|
*
|
2013-09-10 22:02:15 +04:00
|
|
|
* @param string $path relative path of the file or folder
|
2013-09-10 21:34:38 +04:00
|
|
|
* @return \OCP\Files\Node
|
2013-09-10 22:02:15 +04:00
|
|
|
* @throws \OCP\Files\NotFoundException
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function get($path);
|
|
|
|
|
|
|
|
/**
|
2013-09-10 22:02:15 +04:00
|
|
|
* Check if a file or folder exists in the folder
|
|
|
|
*
|
|
|
|
* @param string $path relative path of the file or folder
|
2013-09-06 22:38:59 +04:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function nodeExists($path);
|
|
|
|
|
|
|
|
/**
|
2013-09-10 22:02:15 +04:00
|
|
|
* Create a new folder
|
|
|
|
*
|
|
|
|
* @param string $path relative path of the new folder
|
2013-09-10 21:34:38 +04:00
|
|
|
* @return \OCP\Files\Folder
|
2013-09-10 22:02:15 +04:00
|
|
|
* @throws \OCP\Files\NotPermittedException
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function newFolder($path);
|
|
|
|
|
|
|
|
/**
|
2013-09-10 22:02:15 +04:00
|
|
|
* Create a new file
|
|
|
|
*
|
|
|
|
* @param string $path relative path of the new file
|
2013-09-10 21:34:38 +04:00
|
|
|
* @return \OCP\Files\File
|
2013-09-10 22:02:15 +04:00
|
|
|
* @throws \OCP\Files\NotPermittedException
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function newFile($path);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* search for files with the name matching $query
|
|
|
|
*
|
|
|
|
* @param string $query
|
2013-09-10 21:34:38 +04:00
|
|
|
* @return \OCP\Files\Node[]
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function search($query);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* search for files by mimetype
|
2013-09-10 22:02:15 +04:00
|
|
|
* $mimetype can either be a full mimetype (image/png) or a wildcard mimetype (image)
|
2013-09-06 22:38:59 +04:00
|
|
|
*
|
|
|
|
* @param string $mimetype
|
2013-09-10 21:34:38 +04:00
|
|
|
* @return \OCP\Files\Node[]
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function searchByMime($mimetype);
|
|
|
|
|
|
|
|
/**
|
2013-09-10 22:02:15 +04:00
|
|
|
* get a file or folder inside the folder by it's internal id
|
|
|
|
*
|
|
|
|
* @param int $id
|
2013-09-10 21:34:38 +04:00
|
|
|
* @return \OCP\Files\Node[]
|
2013-09-06 22:38:59 +04:00
|
|
|
*/
|
|
|
|
public function getById($id);
|
|
|
|
|
2013-09-10 22:02:15 +04:00
|
|
|
/**
|
|
|
|
* Get the amount of free space inside the folder
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
2013-09-06 22:38:59 +04:00
|
|
|
public function getFreeSpace();
|
|
|
|
|
|
|
|
/**
|
2013-09-10 22:02:15 +04:00
|
|
|
* Check if new files or folders can be created within the folder
|
|
|
|
*
|
2013-09-06 22:38:59 +04:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function isCreatable();
|
|
|
|
}
|