Folder

class OC\Files\Node\Folder
Source:lib/private/Files/Node/Folder.php#51
Parent:OC\Files\Node\Node
Implements:OCP\Files\Folder

Methods

protected OC\Files\Node\Folder::createNonExistingNode($path)
Creates a Folder that represents a non-existing path
Source:

lib/private/Files/Node/Folder.php#58

Parameters:
  • $path (string) path
Returns:

string non-existing node class

public OC\Files\Node\Folder::getFullPath($path)
Source:

lib/private/Files/Node/Folder.php#67

Parameters:
  • $path (string) path relative to the folder
Returns:

string

Throws:

\OCP\Files\NotPermittedException

public OC\Files\Node\Folder::getRelativePath($path)
Source:

lib/private/Files/Node/Folder.php#78

Parameters:
  • $path (string)
Returns:

string | null

public OC\Files\Node\Folder::isSubNode($node)
check if a node is a (grand-)child of the folder
Source:

lib/private/Files/Node/Folder.php#98

Parameters:
Returns:

bool

public OC\Files\Node\Folder::getDirectoryListing()
get the content of this directory
Source:lib/private/Files/Node/Folder.php#108
Returns:\OC\Files\Node\Node[]
Throws:\OCP\Files\NotFoundException
protected OC\Files\Node\Folder::createNode($path, $info=null)
Source:

lib/private/Files/Node/Folder.php#125

Parameters:
Returns:

\OC\Files\Node\File | \OC\Files\Node\Folder

public OC\Files\Node\Folder::get($path)
Get the node at $path
Source:

lib/private/Files/Node/Folder.php#145

Parameters:
  • $path (string)
Returns:

\OC\Files\Node\Node

Throws:

\OCP\Files\NotFoundException

public OC\Files\Node\Folder::nodeExists($path)
Source:

lib/private/Files/Node/Folder.php#153

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Node\Folder::newFolder($path)
Source:

lib/private/Files/Node/Folder.php#167

Parameters:
  • $path (string)
Returns:

\OC\Files\Node\Folder

Throws:

\OCP\Files\NotPermittedException

public OC\Files\Node\Folder::newFile($path, $content=null)
Source:

lib/private/Files/Node/Folder.php#189

Parameters:
  • $path (string)
Returns:

\OC\Files\Node\File

Throws:

\OCP\Files\NotPermittedException

public OC\Files\Node\Folder::search($query)
search for files with the name matching $query
Source:

lib/private/Files/Node/Folder.php#229

Parameters:
Returns:

\OC\Files\Node\Node[]

public OC\Files\Node\Folder::searchByMime($mimetype)
search for files by mimetype
Source:

lib/private/Files/Node/Folder.php#338

Parameters:
  • $mimetype (string)
Returns:

\OC\Files\Node\Node[]

public OC\Files\Node\Folder::searchByTag($tag, $userId)
search for files by tag
Source:

lib/private/Files/Node/Folder.php#354

Parameters:
  • $tag (string | int) name or tag id
  • $userId (string) owner of the tags
Returns:

\OC\Files\Node\Node[]

public OC\Files\Node\Folder::getById($id)
Source:

lib/private/Files/Node/Folder.php#363

Parameters:
  • $id (int)
Returns:

\OC\Files\Node\Node[]

protected OC\Files\Node\Folder::getAppDataDirectoryName()
Source:lib/private/Files/Node/Folder.php#415
protected OC\Files\Node\Folder::getByIdInRootMount($id)
In case the path we are currently in is inside the appdata_* folder,
the original getById method does not work, because it can only look inside
the user’s mount points. But the user has no mount point for the root storage.
So in that case we directly check the mount of the root if it contains
the id. If it does we check if the path is inside the path we are working
in.
Source:

lib/private/Files/Node/Folder.php#432

Parameters:
  • $id (int)
Returns:

array

public OC\Files\Node\Folder::getFreeSpace()
Source:lib/private/Files/Node/Folder.php#456
public OC\Files\Node\Folder::delete()
Source:lib/private/Files/Node/Folder.php#460
public OC\Files\Node\Folder::getNonExistingName($name)
Add a suffix to the name in case the file exists
Source:

lib/private/Files/Node/Folder.php#480

Parameters:
  • $name (string)
Returns:

string

Throws:

\OCP\Files\NotPermittedException

public OC\Files\Node\Folder::getRecent($limit, $offset=0)
Source:

lib/private/Files/Node/Folder.php#490

Parameters:
  • $limit (int)
  • $offset (int)
Returns:

\OCP\Files\Node[]