Jail¶
-
class
OC\Files\Storage\Wrapper\
Jail
¶ - Jail to a subdirectory of the wrapped storageThis 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: 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: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
rmdir
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
opendir
($path)¶ -
Source: Parameters: - $path (string)
Returns: resource | bool
-
public
OC\Files\Storage\Wrapper\Jail::
is_dir
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
is_file
($path)¶ -
Source: 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: Parameters: - $path (string)
Returns: array | bool
-
public
OC\Files\Storage\Wrapper\Jail::
filetype
($path)¶ -
Source: 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: Parameters: - $path (string)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Jail::
isCreatable
($path)¶ - check if a file can be created in $path
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
isReadable
($path)¶ - check if a file can be read
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
isUpdatable
($path)¶ - check if a file can be written to
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
isDeletable
($path)¶ - check if a file can be deleted
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
isSharable
($path)¶ - check if a file can be shared
Source: 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: Parameters: - $path (string)
Returns: int
-
public
OC\Files\Storage\Wrapper\Jail::
file_exists
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
filemtime
($path)¶ -
Source: Parameters: - $path (string)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Jail::
file_get_contents
($path)¶ -
Source: Parameters: - $path (string)
Returns: string | bool
-
public
OC\Files\Storage\Wrapper\Jail::
file_put_contents
($path, $data)¶ -
Source: Parameters: - $path (string)
- $data (mixed)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Jail::
unlink
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
rename
($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
copy
($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Jail::
fopen
($path, $mode)¶ -
Source: Parameters: - $path (string)
- $mode (string)
Returns: resource | bool
-
public
OC\Files\Storage\Wrapper\Jail::
getMimeType
($path)¶ - get the mimetype for a file or folderThe mimetype for a folder is required to be “httpd/unix-directory”
Source: Parameters: - $path (string)
Returns: string | bool
-
public
OC\Files\Storage\Wrapper\Jail::
hash
($type, $path, $raw=false)¶ -
Source: Parameters: - $type (string)
- $path (string)
- $raw (bool)
Returns: string | bool
-
public
OC\Files\Storage\Wrapper\Jail::
free_space
($path)¶ -
Source: Parameters: - $path (string)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Jail::
search
($query)¶ - search for occurrences of $query in file names
Source: 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: 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: 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: 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: Parameters: - $path (string)
Returns:
-
public
OC\Files\Storage\Wrapper\Jail::
getOwner
($path)¶ - get the user id of the owner of a file or folder
Source: Parameters: - $path (string)
Returns: string
-
public
OC\Files\Storage\Wrapper\Jail::
getWatcher
($path="", $storage=null)¶ - get a watcher instance for the cache
Source: Parameters: - $path (string)
Returns:
-
public
OC\Files\Storage\Wrapper\Jail::
getETag
($path)¶ - get the ETag for a file or folder
Source: 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: Parameters: - $path (string)
- $type (int) OCPLockILockingProvider::LOCK_SHARED or OCPLockILockingProvider::LOCK_EXCLUSIVE
- $provider (
OCP\Lock\ILockingProvider
)
Throws:
-
public
OC\Files\Storage\Wrapper\Jail::
releaseLock
($path, $type, $provider)¶ Source: 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: 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: Parameters: - $path (string)
Returns: array
-
public
OC\Files\Storage\Wrapper\Jail::
copyFromStorage
($sourceStorage, $sourceInternalPath, $targetInternalPath)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage
) - $sourceInternalPath (string)
- $targetInternalPath (string)
Returns: bool
- $sourceStorage (
-
public
OC\Files\Storage\Wrapper\Jail::
moveFromStorage
($sourceStorage, $sourceInternalPath, $targetInternalPath)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage
) - $sourceInternalPath (string)
- $targetInternalPath (string)
Returns: bool
- $sourceStorage (
-
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