Jail

class OC\Files\Storage\Wrapper\Jail
Jail to a subdirectory of the wrapped storage
This restricts access to a subfolder of the wrapped storage with the subfolder becoming the root folder new storage
Source:lib/private/Files/Storage/Wrapper/Jail.php#44
Parent:OC\Files\Storage\Wrapper\Wrapper

Properties

protected static property OC\Files\Storage\Wrapper\Jail::$rootPath
Source:lib/private/Files/Storage/Wrapper/Jail.php#48
Type:string

Methods

public OC\Files\Storage\Wrapper\Jail::__construct($arguments)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#56

Parameters:
  • $arguments (array) [‘storage’ => $storage, ‘root’ => $root]

$storage: The storage that will be wrapper $root: The folder in the wrapped storage that will become the root folder of the wrapped storage

public OC\Files\Storage\Wrapper\Jail::getUnjailedPath($path)
Source:lib/private/Files/Storage/Wrapper/Jail.php#61
public OC\Files\Storage\Wrapper\Jail::getUnjailedStorage()
This is separate from Wrapper::getWrapperStorage so we can get the jailed storage consistently even if the jail is inside another wrapper
Source:lib/private/Files/Storage/Wrapper/Jail.php#68
public OC\Files\Storage\Wrapper\Jail::getJailedPath($path)
Source:lib/private/Files/Storage/Wrapper/Jail.php#73
public OC\Files\Storage\Wrapper\Jail::getId()
Source:lib/private/Files/Storage/Wrapper/Jail.php#84
public OC\Files\Storage\Wrapper\Jail::mkdir($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#94

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::rmdir($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#104

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::opendir($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#114

Parameters:
  • $path (string)
Returns:

resource | bool

public OC\Files\Storage\Wrapper\Jail::is_dir($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#124

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::is_file($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#134

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::stat($path)
only the following keys are required in the result: size and mtime
Source:

lib/private/Files/Storage/Wrapper/Jail.php#145

Parameters:
  • $path (string)
Returns:

array | bool

public OC\Files\Storage\Wrapper\Jail::filetype($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#155

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::filesize($path)
The result for filesize when called on a folder is required to be 0
Source:

lib/private/Files/Storage/Wrapper/Jail.php#166

Parameters:
  • $path (string)
Returns:

int | bool

public OC\Files\Storage\Wrapper\Jail::isCreatable($path)
check if a file can be created in $path
Source:

lib/private/Files/Storage/Wrapper/Jail.php#176

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::isReadable($path)
check if a file can be read
Source:

lib/private/Files/Storage/Wrapper/Jail.php#186

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::isUpdatable($path)
check if a file can be written to
Source:

lib/private/Files/Storage/Wrapper/Jail.php#196

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::isDeletable($path)
check if a file can be deleted
Source:

lib/private/Files/Storage/Wrapper/Jail.php#206

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::isSharable($path)
check if a file can be shared
Source:

lib/private/Files/Storage/Wrapper/Jail.php#216

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::getPermissions($path)
get the full permissions of a path.
Should return a combination of the PERMISSION_ constants defined in lib/public/constants.php
Source:

lib/private/Files/Storage/Wrapper/Jail.php#227

Parameters:
  • $path (string)
Returns:

int

public OC\Files\Storage\Wrapper\Jail::file_exists($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#237

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::filemtime($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#247

Parameters:
  • $path (string)
Returns:

int | bool

public OC\Files\Storage\Wrapper\Jail::file_get_contents($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#257

Parameters:
  • $path (string)
Returns:

string | bool

public OC\Files\Storage\Wrapper\Jail::file_put_contents($path, $data)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#268

Parameters:
  • $path (string)
  • $data (mixed)
Returns:

int | bool

Source:

lib/private/Files/Storage/Wrapper/Jail.php#278

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::rename($path1, $path2)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#289

Parameters:
  • $path1 (string)
  • $path2 (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::copy($path1, $path2)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#300

Parameters:
  • $path1 (string)
  • $path2 (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::fopen($path, $mode)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#311

Parameters:
  • $path (string)
  • $mode (string)
Returns:

resource | bool

public OC\Files\Storage\Wrapper\Jail::getMimeType($path)
get the mimetype for a file or folder
The mimetype for a folder is required to be “httpd/unix-directory”
Source:

lib/private/Files/Storage/Wrapper/Jail.php#322

Parameters:
  • $path (string)
Returns:

string | bool

public OC\Files\Storage\Wrapper\Jail::hash($type, $path, $raw=false)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#334

Parameters:
  • $type (string)
  • $path (string)
  • $raw (bool)
Returns:

string | bool

public OC\Files\Storage\Wrapper\Jail::free_space($path)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#344

Parameters:
  • $path (string)
Returns:

int | bool

public OC\Files\Storage\Wrapper\Jail::search($query)
search for occurrences of $query in file names
Source:

lib/private/Files/Storage/Wrapper/Jail.php#354

Parameters:
  • $query (string)
Returns:

array | bool

public OC\Files\Storage\Wrapper\Jail::touch($path, $mtime=null)
If the backend does not support the operation, false should be returned
Source:

lib/private/Files/Storage/Wrapper/Jail.php#366

Parameters:
  • $path (string)
  • $mtime (int)
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::getLocalFile($path)
get the path to a local version of the file.
The local version of the file can be temporary and doesn’t have to be persistent across requests
Source:

lib/private/Files/Storage/Wrapper/Jail.php#377

Parameters:
  • $path (string)
Returns:

string | bool

public OC\Files\Storage\Wrapper\Jail::hasUpdated($path, $time)
check if a file or folder has been updated since $time
Source:

lib/private/Files/Storage/Wrapper/Jail.php#391

Parameters:
  • $path (string)
  • $time (int)
Returns:

bool hasUpdated for folders should return at least true if a file inside the folder is add, removed or renamed. returning true for other changes in the folder is optional

public OC\Files\Storage\Wrapper\Jail::getCache($path="", $storage=null)
get a cache instance for the storage
Source:

lib/private/Files/Storage/Wrapper/Jail.php#402

Parameters:
  • $path (string)
Returns:

\OC\Files\Cache\Cache

public OC\Files\Storage\Wrapper\Jail::getOwner($path)
get the user id of the owner of a file or folder
Source:

lib/private/Files/Storage/Wrapper/Jail.php#416

Parameters:
  • $path (string)
Returns:

string

public OC\Files\Storage\Wrapper\Jail::getWatcher($path="", $storage=null)
get a watcher instance for the cache
Source:

lib/private/Files/Storage/Wrapper/Jail.php#427

Parameters:
  • $path (string)
Returns:

\OC\Files\Cache\Watcher

public OC\Files\Storage\Wrapper\Jail::getETag($path)
get the ETag for a file or folder
Source:

lib/private/Files/Storage/Wrapper/Jail.php#440

Parameters:
  • $path (string)
Returns:

string | bool

public OC\Files\Storage\Wrapper\Jail::getMetaData($path)
Source:lib/private/Files/Storage/Wrapper/Jail.php#444
public OC\Files\Storage\Wrapper\Jail::acquireLock($path, $type, $provider)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#454

Parameters:
  • $path (string)
  • $type (int) OCPLockILockingProvider::LOCK_SHARED or OCPLockILockingProvider::LOCK_EXCLUSIVE
  • $provider (OCP\Lock\ILockingProvider)
Throws:

\OCP\Lock\LockedException

public OC\Files\Storage\Wrapper\Jail::releaseLock($path, $type, $provider)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#463

Parameters:
  • $path (string)
  • $type (int) OCPLockILockingProvider::LOCK_SHARED or OCPLockILockingProvider::LOCK_EXCLUSIVE
  • $provider (OCP\Lock\ILockingProvider)
public OC\Files\Storage\Wrapper\Jail::changeLock($path, $type, $provider)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#472

Parameters:
  • $path (string)
  • $type (int) OCPLockILockingProvider::LOCK_SHARED or OCPLockILockingProvider::LOCK_EXCLUSIVE
  • $provider (OCP\Lock\ILockingProvider)
public OC\Files\Storage\Wrapper\Jail::resolvePath($path)
Resolve the path for the source of the share
Source:

lib/private/Files/Storage/Wrapper/Jail.php#482

Parameters:
  • $path (string)
Returns:

array

public OC\Files\Storage\Wrapper\Jail::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#492

Parameters:
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath)
Source:

lib/private/Files/Storage/Wrapper/Jail.php#505

Parameters:
Returns:

bool

public OC\Files\Storage\Wrapper\Jail::getPropagator($storage=null)
Source:lib/private/Files/Storage/Wrapper/Jail.php#512
public OC\Files\Storage\Wrapper\Jail::writeStream($path, $stream, $size=null)
Source:lib/private/Files/Storage/Wrapper/Jail.php#524
public OC\Files\Storage\Wrapper\Jail::getDirectoryContent($directory)
Source:lib/private/Files/Storage/Wrapper/Jail.php#538