IStorage¶
-
interface
OCP\Files\Storage\
IStorage
¶ - Provide a common interface to all different storage optionsAll paths passed to the storage are relative to the storage and should NOT have a leading slash.
Source: lib/public/Files/Storage/IStorage.php#52
Methods¶
-
public
OCP\Files\Storage\IStorage::
__construct
($parameters)¶ - $parameters is a free form array with the configuration options needed to construct the storage
Source: Parameters: - $parameters (array)
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
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/public/Files/Storage/IStorage.php#69 Returns: string Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
mkdir
($path)¶ - implementations need to implement a recursive mkdir
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
rmdir
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
opendir
($path)¶ -
Source: Parameters: - $path (string)
Returns: resource | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
is_dir
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
is_file
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
stat
($path)¶ - only the following keys are required in the result: size and mtime
Source: Parameters: - $path (string)
Returns: array | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
filetype
($path)¶ -
Source: Parameters: - $path (string)
Returns: string | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
filesize
($path)¶ - The result for filesize when called on a folder is required to be 0
Source: Parameters: - $path (string)
Returns: int | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
isCreatable
($path)¶ - check if a file can be created in $path
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
isReadable
($path)¶ - check if a file can be read
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
isUpdatable
($path)¶ - check if a file can be written to
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
isDeletable
($path)¶ - check if a file can be deleted
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
isSharable
($path)¶ - check if a file can be shared
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
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
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
file_exists
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
filemtime
($path)¶ -
Source: Parameters: - $path (string)
Returns: int | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
file_get_contents
($path)¶ -
Source: Parameters: - $path (string)
Returns: string | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
file_put_contents
($path, $data)¶ -
Source: Parameters: - $path (string)
- $data (mixed)
Returns: int | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
unlink
($path)¶ -
Source: Parameters: - $path (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
rename
($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
copy
($path1, $path2)¶ -
Source: Parameters: - $path1 (string)
- $path2 (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
fopen
($path, $mode)¶ -
Source: Parameters: - $path (string)
- $mode (string)
Returns: resource | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
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
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
hash
($type, $path, $raw=false)¶ -
Source: Parameters: - $type (string)
- $path (string)
- $raw (bool)
Returns: string | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
free_space
($path)¶ -
Source: Parameters: - $path (string)
Returns: int | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
touch
($path, $mtime=null)¶ - If the backend does not support the operation, false should be returned
Source: Parameters: - $path (string)
- $mtime (int)
Returns: bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
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
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
hasUpdated
($path, $time)¶ - check if a file or folder has been updated since $time
Source: Parameters: - $path (string)
- $time (int)
Returns: bool
Since: 9.0.0 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
OCP\Files\Storage\IStorage::
getETag
($path)¶ - get the ETag for a file or folder
Source: Parameters: - $path (string)
Returns: string | bool
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
isLocal
()¶ - Returns whether the storage is local, which means that filesare stored on the local filesystem instead of remotely.Calling getLocalFile() for local storages should alwaysreturn the local files, whereas for non-local storagesit might return a temporary file.
Source: lib/public/Files/Storage/IStorage.php#360 Returns: bool true if the files are stored locally, false otherwise Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
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
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
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
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
verifyPath
($path, $fileName)¶ Source: Parameters: - $path (string) the path of the target folder
- $fileName (string) the name of the file itself
Returns: void
Throws: Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
copyFromStorage
($sourceStorage, $sourceInternalPath, $targetInternalPath)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage
) - $sourceInternalPath (string)
- $targetInternalPath (string)
Returns: bool
Since: 9.0.0
- $sourceStorage (
-
public
OCP\Files\Storage\IStorage::
moveFromStorage
($sourceStorage, $sourceInternalPath, $targetInternalPath)¶ Source: Parameters: - $sourceStorage (
OCP\Files\Storage\IStorage
) - $sourceInternalPath (string)
- $targetInternalPath (string)
Returns: bool
Since: 9.0.0
- $sourceStorage (
-
public
OCP\Files\Storage\IStorage::
test
()¶ - Test a storage for availability
Source: lib/public/Files/Storage/IStorage.php#415 Since: 9.0.0 Returns: bool
-
public
OCP\Files\Storage\IStorage::
getAvailability
()¶ Source: lib/public/Files/Storage/IStorage.php#421 Since: 9.0.0 Returns: array [ available, last_checked ]
-
public
OCP\Files\Storage\IStorage::
setAvailability
($isAvailable)¶ Source: Parameters: - $isAvailable (bool)
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
getOwner
($path)¶ Source: Parameters: - $path (string) path for which to retrieve the owner
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
getCache
()¶ Source: lib/public/Files/Storage/IStorage.php#439 Returns: \OCP\Files\Cache\ICache
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
getPropagator
()¶ Source: lib/public/Files/Storage/IStorage.php#445 Returns: \OCP\Files\Cache\IPropagator
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
getScanner
()¶ Source: lib/public/Files/Storage/IStorage.php#451 Returns: \OCP\Files\Cache\IScanner
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
getUpdater
()¶ Source: lib/public/Files/Storage/IStorage.php#457 Returns: \OCP\Files\Cache\IUpdater
Since: 9.0.0
-
public
OCP\Files\Storage\IStorage::
getWatcher
()¶ Source: lib/public/Files/Storage/IStorage.php#463 Returns: \OCP\Files\Cache\IWatcher
Since: 9.0.0