Wrapper

class OC\Files\Storage\Wrapper\Wrapper
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#41
Implements:OC\Files\Storage\Storage OCP\Files\Storage\ILockingStorage OCP\Files\Storage\IWriteStreamStorage

Properties

protected static property OC\Files\Storage\Wrapper\Wrapper::$storage
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#45
Type:\OC\Files\Storage\Storage
public static property OC\Files\Storage\Wrapper\Wrapper::$cache
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#47
public static property OC\Files\Storage\Wrapper\Wrapper::$scanner
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#48
public static property OC\Files\Storage\Wrapper\Wrapper::$watcher
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#49
public static property OC\Files\Storage\Wrapper\Wrapper::$propagator
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#50
public static property OC\Files\Storage\Wrapper\Wrapper::$updater
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#51

Methods

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

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

Parameters:
  • $parameters (array)
public OC\Files\Storage\Wrapper\Wrapper::getWrapperStorage()
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#63
Returns:\OC\Files\Storage\Storage
public OC\Files\Storage\Wrapper\Wrapper::getId()
Get the identifier for the storage,
the returned id should be the same for every storage object that is created with the same parameters
and two storage objects with the same id should refer to two storages that display the same files.
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#74
Returns:string
public OC\Files\Storage\Wrapper\Wrapper::mkdir($path)
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#84

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

resource | bool

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

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

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#135

Parameters:
  • $path (string)
Returns:

array | bool

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

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

Parameters:
  • $path (string)
Returns:

string | bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#156

Parameters:
  • $path (string)
Returns:

int | bool

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

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

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Wrapper::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/Wrapper.php#217

Parameters:
  • $path (string)
Returns:

int

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

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

Parameters:
  • $path (string)
Returns:

bool

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

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

Parameters:
  • $path (string)
Returns:

int | bool

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

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

Parameters:
  • $path (string)
Returns:

string | bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#258

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

int | bool

Source:

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

Parameters:
  • $path (string)
Returns:

bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#279

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

bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#290

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

bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#301

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

resource | bool

public OC\Files\Storage\Wrapper\Wrapper::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/Wrapper.php#312

Parameters:
  • $path (string)
Returns:

string | bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#324

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

string | bool

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

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

Parameters:
  • $path (string)
Returns:

int | bool

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

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

Parameters:
  • $query (string)
Returns:

array | bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#356

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

bool

public OC\Files\Storage\Wrapper\Wrapper::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/Wrapper.php#367

Parameters:
  • $path (string)
Returns:

string | bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#381

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\Wrapper::getCache($path="", $storage=null)
get a cache instance for the storage
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#392

Parameters:
  • $path (string)
Returns:

\OC\Files\Cache\Cache

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

lib/private/Files/Storage/Wrapper/Wrapper.php#406

Parameters:
  • $path (string)
Returns:

\OC\Files\Cache\Scanner

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

lib/private/Files/Storage/Wrapper/Wrapper.php#420

Parameters:
  • $path (string)
Returns:

string

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

lib/private/Files/Storage/Wrapper/Wrapper.php#431

Parameters:
  • $path (string)
Returns:

\OC\Files\Cache\Watcher

public OC\Files\Storage\Wrapper\Wrapper::getPropagator($storage=null)
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#438
public OC\Files\Storage\Wrapper\Wrapper::getUpdater($storage=null)
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#445
public OC\Files\Storage\Wrapper\Wrapper::getStorageCache()
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#455
Returns:\OC\Files\Cache\Storage
public OC\Files\Storage\Wrapper\Wrapper::getETag($path)
get the ETag for a file or folder
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#465

Parameters:
  • $path (string)
Returns:

string | bool

public OC\Files\Storage\Wrapper\Wrapper::test()
Returns true
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#474
Returns:bool
public OC\Files\Storage\Wrapper\Wrapper::isLocal()
Returns the wrapped storage’s value for isLocal()
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#483
Returns:bool wrapped storage’s isLocal() value
public OC\Files\Storage\Wrapper\Wrapper::instanceOfStorage($class)
Check if the storage is an instance of $class or is a wrapper for a storage that is an instance of $class
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#493

Parameters:
  • $class (string)
Returns:

bool

public OC\Files\Storage\Wrapper\Wrapper::__call($method, $args)
Pass any methods custom to specific storage implementations to the wrapped storage
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#508

Parameters:
  • $method (string)
  • $args (array)
Returns:

mixed

public OC\Files\Storage\Wrapper\Wrapper::getDirectDownload($path)
A custom storage implementation can return an url for direct download of a give file.
For now the returned array can hold the parameter url - in future more attributes might follow.
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#520

Parameters:
  • $path (string)
Returns:

array | bool

public OC\Files\Storage\Wrapper\Wrapper::getAvailability()
Get availability of the storage
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#529
Returns:array [ available, last_checked ]
public OC\Files\Storage\Wrapper\Wrapper::setAvailability($isAvailable)
Set availability of the storage
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#538

Parameters:
  • $isAvailable (bool)
public OC\Files\Storage\Wrapper\Wrapper::verifyPath($path, $fileName)
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#548

Parameters:
  • $path (string) the path of the target folder
  • $fileName (string) the name of the file itself
Returns:

void

Throws:

\OCP\Files\InvalidPathException

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

lib/private/Files/Storage/Wrapper/Wrapper.php#558

Parameters:
Returns:

bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#572

Parameters:
Returns:

bool

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

lib/private/Files/Storage/Wrapper/Wrapper.php#590

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\Wrapper::releaseLock($path, $type, $provider)
Source:

lib/private/Files/Storage/Wrapper/Wrapper.php#601

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

lib/private/Files/Storage/Wrapper/Wrapper.php#612

Parameters:
  • $path (string)
  • $type (int) OCPLockILockingProvider::LOCK_SHARED or OCPLockILockingProvider::LOCK_EXCLUSIVE
  • $provider (OCP\Lock\ILockingProvider)
public OC\Files\Storage\Wrapper\Wrapper::needsPartFile()
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#621
Returns:bool
public OC\Files\Storage\Wrapper\Wrapper::writeStream($path, $stream, $size=null)
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#625
public OC\Files\Storage\Wrapper\Wrapper::getDirectoryContent($directory)
Source:lib/private/Files/Storage/Wrapper/Wrapper.php#639