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: 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 parametersand 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: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
rmdir
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
opendir
($path)¶ -
Source: Parameters: - $path (string)
Returns: resource | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
is_dir
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
is_file
($path)¶ -
Source: 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: Parameters: - $path (string)
Returns: array | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
filetype
($path)¶ -
Source: 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: Parameters: - $path (string)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
isCreatable
($path)¶ - check if a file can be created in $path
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
isReadable
($path)¶ - check if a file can be read
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
isUpdatable
($path)¶ - check if a file can be written to
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
isDeletable
($path)¶ - check if a file can be deleted
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
isSharable
($path)¶ - check if a file can be shared
Source: 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: Parameters: - $path (string)
Returns: int
-
public
OC\Files\Storage\Wrapper\Wrapper::
file_exists
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
filemtime
($path)¶ -
Source: Parameters: - $path (string)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
file_get_contents
($path)¶ -
Source: Parameters: - $path (string)
Returns: string | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
file_put_contents
($path, $data)¶ -
Source: Parameters: - $path (string)
- $data (mixed)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
unlink
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
rename
($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
copy
($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
fopen
($path, $mode)¶ -
Source: Parameters: - $path (string)
- $mode (string)
Returns: resource | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
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\Wrapper::
hash
($type, $path, $raw=false)¶ -
Source: Parameters: - $type (string)
- $path (string)
- $raw (bool)
Returns: string | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
free_space
($path)¶ -
Source: Parameters: - $path (string)
Returns: int | bool
-
public
OC\Files\Storage\Wrapper\Wrapper::
search
($query)¶ - search for occurrences of $query in file names
Source: 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: 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: 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: 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: Parameters: - $path (string)
Returns:
-
public
OC\Files\Storage\Wrapper\Wrapper::
getScanner
($path="", $storage=null)¶ - get a scanner instance for the storage
Source: Parameters: - $path (string)
Returns:
-
public
OC\Files\Storage\Wrapper\Wrapper::
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\Wrapper::
getWatcher
($path="", $storage=null)¶ - get a watcher instance for the cache
Source: Parameters: - $path (string)
Returns:
-
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: 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: 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: 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: 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: Parameters: - $isAvailable (bool)
-
public
OC\Files\Storage\Wrapper\Wrapper::
verifyPath
($path, $fileName)¶ Source: Parameters: - $path (string) the path of the target folder
- $fileName (string) the name of the file itself
Returns: void
Throws:
-
public
OC\Files\Storage\Wrapper\Wrapper::
copyFromStorage
($sourceStorage, $sourceInternalPath, $targetInternalPath)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage
) - $sourceInternalPath (string)
- $targetInternalPath (string)
Returns: bool
- $sourceStorage (
-
public
OC\Files\Storage\Wrapper\Wrapper::
moveFromStorage
($sourceStorage, $sourceInternalPath, $targetInternalPath)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage
) - $sourceInternalPath (string)
- $targetInternalPath (string)
Returns: bool
- $sourceStorage (
-
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: Parameters: - $path (string)
- $type (int) OCPLockILockingProvider::LOCK_SHARED or OCPLockILockingProvider::LOCK_EXCLUSIVE
- $provider (
OCP\Lock\ILockingProvider
)
Throws:
-
public
OC\Files\Storage\Wrapper\Wrapper::
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\Wrapper::
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\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