\OCP\Files\StorageStorageAdapter

Storage adapter implementing most of the common methods from IStorage.

Summary

Methods
Properties
Constants
getId()
mkdir()
rmdir()
opendir()
stat()
filetype()
file_exists()
unlink()
fopen()
touch()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getId()

getId() : string

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.

Returns

string —

storage id

mkdir()

mkdir(string  $path) : boolean

see http://php.net/manual/en/function.mkdir.php implementations need to implement a recursive mkdir

Parameters

string $path

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

boolean —

true on success, false otherwise

rmdir()

rmdir(string  $path) : boolean

see http://php.net/manual/en/function.rmdir.php

Parameters

string $path

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

boolean —

true on success, false otherwise

opendir()

opendir(string  $path) : resource|false

see http://php.net/manual/en/function.opendir.php

Parameters

string $path

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

resource|false

stat()

stat(string  $path) : array|false

see http://php.net/manual/en/function.stat.php only the following keys are required in the result: size and mtime

Parameters

string $path

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

array|false

filetype()

filetype(string  $path) : string|false

see http://php.net/manual/en/function.filetype.php

Parameters

string $path

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

string|false

file_exists()

file_exists(string  $path) : boolean

see http://php.net/manual/en/function.file_exists.php

Parameters

string $path

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

boolean

unlink()

unlink(string  $path) : boolean

see http://php.net/manual/en/function.unlink.php

Parameters

string $path

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

boolean —

true on success, false otherwise

fopen()

fopen(string  $path, string  $mode) : resource|false

see http://php.net/manual/en/function.fopen.php

Parameters

string $path
string $mode

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

resource|false

touch()

touch(string  $path, integer  $mtime = NULL) : boolean

see http://php.net/manual/en/function.touch.php If the backend does not support the operation, false should be returned

Parameters

string $path
integer $mtime

Throws

\OCP\Files\StorageNotAvailableException

if the storage is temporarily not available

Returns

boolean —

true on success, false otherwise