Folder¶
-
interface
OCP\Files\
Folder
¶ Implemented by: OC\Files\Node\LazyFolder
OC\Files\Node\Folder
Source: lib/public/Files/Folder.php#42 Parent: OCP\Files\Node
Methods¶
-
public
OCP\Files\Folder::
getFullPath
($path)¶ - Get the full path of an item in the folder within owncloud’s filesystem
Source: Parameters: - $path (string) relative path of an item in the folder
Returns: string
Throws: Since: 6.0.0
-
public
OCP\Files\Folder::
getRelativePath
($path)¶ - Get the path of an item in the folder relative to the folder
Source: Parameters: - $path (string) absolute path of an item in the folder
Throws: Returns: string | null
Since: 6.0.0
-
public
OCP\Files\Folder::
isSubNode
($node)¶ - check if a node is a (grand-)child of the folder
Source: Parameters: - $node (
OCP\Files\Node
)
Returns: bool
Since: 6.0.0
- $node (
-
public
OCP\Files\Folder::
getDirectoryListing
()¶ - get the content of this directory
Source: lib/public/Files/Folder.php#79 Throws: \OCP\Files\NotFoundException
Returns: \OCP\Files\Node[]
Since: 6.0.0
-
public
OCP\Files\Folder::
get
($path)¶ - Get the node at $path
Source: Parameters: - $path (string) relative path of the file or folder
Returns: Throws: Since: 6.0.0
-
public
OCP\Files\Folder::
nodeExists
($path)¶ - Check if a file or folder exists in the folder
Source: Parameters: - $path (string) relative path of the file or folder
Returns: bool
Since: 6.0.0
-
public
OCP\Files\Folder::
newFolder
($path)¶ - Create a new folder
Source: Parameters: - $path (string) relative path of the new folder
Returns: Throws: Since: 6.0.0
-
public
OCP\Files\Folder::
newFile
($path, $content=null)¶ - Create a new file
Source: Parameters: - $path (string) relative path of the new file
- $content (string | resource | null) content for the new file, since 19.0.0
Returns: Throws: Since: 6.0.0
-
public
OCP\Files\Folder::
search
($query)¶ - search for files with the name matching $query
Source: Parameters: - $query (string |
\OCP\Files\Search\ISearchQuery
)
Returns: Since: 6.0.0
- $query (string |
-
public
OCP\Files\Folder::
searchByMime
($mimetype)¶ - search for files by mimetype$mimetype can either be a full mimetype (image/png) or a wildcard mimetype (image)
Source: Parameters: - $mimetype (string)
Returns: Since: 6.0.0
-
public
OCP\Files\Folder::
searchByTag
($tag, $userId)¶ - search for files by tag
Source: Parameters: - $tag (string | int) tag name or tag id
- $userId (string) owner of the tags
Returns: Since: 8.0.0
-
public
OCP\Files\Folder::
getById
($id)¶ - get a file or folder inside the folder by it’s internal idThis method could return multiple entries. For example once the file/folderis shared or mounted (files_external) to the user multiple times.
Source: Parameters: - $id (int)
Returns: Since: 6.0.0
-
public
OCP\Files\Folder::
getFreeSpace
()¶ - Get the amount of free space inside the folder
Source: lib/public/Files/Folder.php#168 Returns: int Since: 6.0.0
-
public
OCP\Files\Folder::
isCreatable
()¶ - Check if new files or folders can be created within the folder
Source: lib/public/Files/Folder.php#176 Returns: bool Since: 6.0.0
-
public
OCP\Files\Folder::
getNonExistingName
($name)¶ - Add a suffix to the name in case the file exists
Source: Parameters: - $name (string)
Returns: string
Throws: Since: 8.1.0
-
public
OCP\Files\Folder::
getRecent
($limit, $offset=0)¶ Source: Parameters: - $limit (int)
- $offset (int)
Returns: Since: 9.1.0