@@ -58,20 +58,20 @@ |
||
58 | 58 | * @since 8.0.0 |
59 | 59 | */ |
60 | 60 | class Constants { |
61 | - /** |
|
62 | - * CRUDS permissions. |
|
63 | - * @since 8.0.0 |
|
64 | - */ |
|
65 | - const PERMISSION_CREATE = 4; |
|
66 | - const PERMISSION_READ = 1; |
|
67 | - const PERMISSION_UPDATE = 2; |
|
68 | - const PERMISSION_DELETE = 8; |
|
69 | - const PERMISSION_SHARE = 16; |
|
70 | - const PERMISSION_ALL = 31; |
|
61 | + /** |
|
62 | + * CRUDS permissions. |
|
63 | + * @since 8.0.0 |
|
64 | + */ |
|
65 | + const PERMISSION_CREATE = 4; |
|
66 | + const PERMISSION_READ = 1; |
|
67 | + const PERMISSION_UPDATE = 2; |
|
68 | + const PERMISSION_DELETE = 8; |
|
69 | + const PERMISSION_SHARE = 16; |
|
70 | + const PERMISSION_ALL = 31; |
|
71 | 71 | |
72 | - /** |
|
73 | - * @since 8.0.0 - Updated in 9.0.0 to allow all POSIX chars since we no |
|
74 | - * longer support windows as server platform. |
|
75 | - */ |
|
76 | - const FILENAME_INVALID_CHARS = "\\/"; |
|
72 | + /** |
|
73 | + * @since 8.0.0 - Updated in 9.0.0 to allow all POSIX chars since we no |
|
74 | + * longer support windows as server platform. |
|
75 | + */ |
|
76 | + const FILENAME_INVALID_CHARS = "\\/"; |
|
77 | 77 | } |
@@ -34,46 +34,46 @@ |
||
34 | 34 | **/ |
35 | 35 | interface IMimeTypeDetector { |
36 | 36 | |
37 | - /** |
|
38 | - * detect mimetype only based on filename, content of file is not used |
|
39 | - * @param string $path |
|
40 | - * @return string |
|
41 | - * @since 8.2.0 |
|
42 | - **/ |
|
43 | - public function detectPath($path); |
|
37 | + /** |
|
38 | + * detect mimetype only based on filename, content of file is not used |
|
39 | + * @param string $path |
|
40 | + * @return string |
|
41 | + * @since 8.2.0 |
|
42 | + **/ |
|
43 | + public function detectPath($path); |
|
44 | 44 | |
45 | - /** |
|
46 | - * detect mimetype based on both filename and content |
|
47 | - * |
|
48 | - * @param string $path |
|
49 | - * @return string |
|
50 | - * @since 8.2.0 |
|
51 | - */ |
|
52 | - public function detect($path); |
|
45 | + /** |
|
46 | + * detect mimetype based on both filename and content |
|
47 | + * |
|
48 | + * @param string $path |
|
49 | + * @return string |
|
50 | + * @since 8.2.0 |
|
51 | + */ |
|
52 | + public function detect($path); |
|
53 | 53 | |
54 | - /** |
|
55 | - * Get a secure mimetype that won't expose potential XSS. |
|
56 | - * |
|
57 | - * @param string $mimeType |
|
58 | - * @return string |
|
59 | - * @since 8.2.0 |
|
60 | - */ |
|
61 | - public function getSecureMimeType($mimeType); |
|
54 | + /** |
|
55 | + * Get a secure mimetype that won't expose potential XSS. |
|
56 | + * |
|
57 | + * @param string $mimeType |
|
58 | + * @return string |
|
59 | + * @since 8.2.0 |
|
60 | + */ |
|
61 | + public function getSecureMimeType($mimeType); |
|
62 | 62 | |
63 | - /** |
|
64 | - * detect mimetype based on the content of a string |
|
65 | - * |
|
66 | - * @param string $data |
|
67 | - * @return string |
|
68 | - * @since 8.2.0 |
|
69 | - */ |
|
70 | - public function detectString($data); |
|
63 | + /** |
|
64 | + * detect mimetype based on the content of a string |
|
65 | + * |
|
66 | + * @param string $data |
|
67 | + * @return string |
|
68 | + * @since 8.2.0 |
|
69 | + */ |
|
70 | + public function detectString($data); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Get path to the icon of a file type |
|
74 | - * @param string $mimeType the MIME type |
|
75 | - * @return string the url |
|
76 | - * @since 8.2.0 |
|
77 | - */ |
|
78 | - public function mimeTypeIcon($mimeType); |
|
72 | + /** |
|
73 | + * Get path to the icon of a file type |
|
74 | + * @param string $mimeType the MIME type |
|
75 | + * @return string the url |
|
76 | + * @since 8.2.0 |
|
77 | + */ |
|
78 | + public function mimeTypeIcon($mimeType); |
|
79 | 79 | } |
@@ -31,49 +31,49 @@ |
||
31 | 31 | * @since 9.0.0 |
32 | 32 | */ |
33 | 33 | interface ICachedMountInfo { |
34 | - /** |
|
35 | - * @return IUser |
|
36 | - * @since 9.0.0 |
|
37 | - */ |
|
38 | - public function getUser(); |
|
34 | + /** |
|
35 | + * @return IUser |
|
36 | + * @since 9.0.0 |
|
37 | + */ |
|
38 | + public function getUser(); |
|
39 | 39 | |
40 | - /** |
|
41 | - * @return int the numeric storage id of the mount |
|
42 | - * @since 9.0.0 |
|
43 | - */ |
|
44 | - public function getStorageId(); |
|
40 | + /** |
|
41 | + * @return int the numeric storage id of the mount |
|
42 | + * @since 9.0.0 |
|
43 | + */ |
|
44 | + public function getStorageId(); |
|
45 | 45 | |
46 | - /** |
|
47 | - * @return int the fileid of the root of the mount |
|
48 | - * @since 9.0.0 |
|
49 | - */ |
|
50 | - public function getRootId(); |
|
46 | + /** |
|
47 | + * @return int the fileid of the root of the mount |
|
48 | + * @since 9.0.0 |
|
49 | + */ |
|
50 | + public function getRootId(); |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return Node the root node of the mount |
|
54 | - * @since 9.0.0 |
|
55 | - */ |
|
56 | - public function getMountPointNode(); |
|
52 | + /** |
|
53 | + * @return Node the root node of the mount |
|
54 | + * @since 9.0.0 |
|
55 | + */ |
|
56 | + public function getMountPointNode(); |
|
57 | 57 | |
58 | - /** |
|
59 | - * @return string the mount point of the mount for the user |
|
60 | - * @since 9.0.0 |
|
61 | - */ |
|
62 | - public function getMountPoint(); |
|
58 | + /** |
|
59 | + * @return string the mount point of the mount for the user |
|
60 | + * @since 9.0.0 |
|
61 | + */ |
|
62 | + public function getMountPoint(); |
|
63 | 63 | |
64 | - /** |
|
65 | - * Get the id of the configured mount |
|
66 | - * |
|
67 | - * @return int|null mount id or null if not applicable |
|
68 | - * @since 9.1.0 |
|
69 | - */ |
|
70 | - public function getMountId(); |
|
64 | + /** |
|
65 | + * Get the id of the configured mount |
|
66 | + * |
|
67 | + * @return int|null mount id or null if not applicable |
|
68 | + * @since 9.1.0 |
|
69 | + */ |
|
70 | + public function getMountId(); |
|
71 | 71 | |
72 | - /** |
|
73 | - * Get the internal path (within the storage) of the root of the mount |
|
74 | - * |
|
75 | - * @return string |
|
76 | - * @since 11.0.0 |
|
77 | - */ |
|
78 | - public function getRootInternalPath(); |
|
72 | + /** |
|
73 | + * Get the internal path (within the storage) of the root of the mount |
|
74 | + * |
|
75 | + * @return string |
|
76 | + * @since 11.0.0 |
|
77 | + */ |
|
78 | + public function getRootInternalPath(); |
|
79 | 79 | } |
@@ -31,13 +31,13 @@ |
||
31 | 31 | * @since 8.0.0 |
32 | 32 | */ |
33 | 33 | interface IMountProvider { |
34 | - /** |
|
35 | - * Get all mountpoints applicable for the user |
|
36 | - * |
|
37 | - * @param \OCP\IUser $user |
|
38 | - * @param \OCP\Files\Storage\IStorageFactory $loader |
|
39 | - * @return \OCP\Files\Mount\IMountPoint[] |
|
40 | - * @since 8.0.0 |
|
41 | - */ |
|
42 | - public function getMountsForUser(IUser $user, IStorageFactory $loader); |
|
34 | + /** |
|
35 | + * Get all mountpoints applicable for the user |
|
36 | + * |
|
37 | + * @param \OCP\IUser $user |
|
38 | + * @param \OCP\Files\Storage\IStorageFactory $loader |
|
39 | + * @return \OCP\Files\Mount\IMountPoint[] |
|
40 | + * @since 8.0.0 |
|
41 | + */ |
|
42 | + public function getMountsForUser(IUser $user, IStorageFactory $loader); |
|
43 | 43 | } |
@@ -31,13 +31,13 @@ |
||
31 | 31 | * @since 9.1.0 |
32 | 32 | */ |
33 | 33 | interface IHomeMountProvider { |
34 | - /** |
|
35 | - * Get all mountpoints applicable for the user |
|
36 | - * |
|
37 | - * @param \OCP\IUser $user |
|
38 | - * @param \OCP\Files\Storage\IStorageFactory $loader |
|
39 | - * @return \OCP\Files\Mount\IMountPoint|null |
|
40 | - * @since 9.1.0 |
|
41 | - */ |
|
42 | - public function getHomeMountForUser(IUser $user, IStorageFactory $loader); |
|
34 | + /** |
|
35 | + * Get all mountpoints applicable for the user |
|
36 | + * |
|
37 | + * @param \OCP\IUser $user |
|
38 | + * @param \OCP\Files\Storage\IStorageFactory $loader |
|
39 | + * @return \OCP\Files\Mount\IMountPoint|null |
|
40 | + * @since 9.1.0 |
|
41 | + */ |
|
42 | + public function getHomeMountForUser(IUser $user, IStorageFactory $loader); |
|
43 | 43 | } |
@@ -31,37 +31,37 @@ |
||
31 | 31 | **/ |
32 | 32 | interface IMimeTypeLoader { |
33 | 33 | |
34 | - /** |
|
35 | - * Get a mimetype from its ID |
|
36 | - * |
|
37 | - * @param int $id |
|
38 | - * @return string|null |
|
39 | - * @since 8.2.0 |
|
40 | - */ |
|
41 | - public function getMimetypeById($id); |
|
34 | + /** |
|
35 | + * Get a mimetype from its ID |
|
36 | + * |
|
37 | + * @param int $id |
|
38 | + * @return string|null |
|
39 | + * @since 8.2.0 |
|
40 | + */ |
|
41 | + public function getMimetypeById($id); |
|
42 | 42 | |
43 | - /** |
|
44 | - * Get a mimetype ID, adding the mimetype to the DB if it does not exist |
|
45 | - * |
|
46 | - * @param string $mimetype |
|
47 | - * @return int |
|
48 | - * @since 8.2.0 |
|
49 | - */ |
|
50 | - public function getId($mimetype); |
|
43 | + /** |
|
44 | + * Get a mimetype ID, adding the mimetype to the DB if it does not exist |
|
45 | + * |
|
46 | + * @param string $mimetype |
|
47 | + * @return int |
|
48 | + * @since 8.2.0 |
|
49 | + */ |
|
50 | + public function getId($mimetype); |
|
51 | 51 | |
52 | - /** |
|
53 | - * Test if a mimetype exists in the database |
|
54 | - * |
|
55 | - * @param string $mimetype |
|
56 | - * @return bool |
|
57 | - * @since 8.2.0 |
|
58 | - */ |
|
59 | - public function exists($mimetype); |
|
52 | + /** |
|
53 | + * Test if a mimetype exists in the database |
|
54 | + * |
|
55 | + * @param string $mimetype |
|
56 | + * @return bool |
|
57 | + * @since 8.2.0 |
|
58 | + */ |
|
59 | + public function exists($mimetype); |
|
60 | 60 | |
61 | - /** |
|
62 | - * Clear all loaded mimetypes, allow for re-loading |
|
63 | - * |
|
64 | - * @since 8.2.0 |
|
65 | - */ |
|
66 | - public function reset(); |
|
61 | + /** |
|
62 | + * Clear all loaded mimetypes, allow for re-loading |
|
63 | + * |
|
64 | + * @since 8.2.0 |
|
65 | + */ |
|
66 | + public function reset(); |
|
67 | 67 | } |
@@ -36,27 +36,27 @@ |
||
36 | 36 | * @since 7.0.0 |
37 | 37 | */ |
38 | 38 | class LockNotAcquiredException extends \Exception { |
39 | - /** @var string $path The path that could not be locked */ |
|
40 | - public $path; |
|
39 | + /** @var string $path The path that could not be locked */ |
|
40 | + public $path; |
|
41 | 41 | |
42 | - /** @var integer $lockType The type of the lock that was attempted */ |
|
43 | - public $lockType; |
|
42 | + /** @var integer $lockType The type of the lock that was attempted */ |
|
43 | + public $lockType; |
|
44 | 44 | |
45 | - /** |
|
46 | - * @since 7.0.0 |
|
47 | - */ |
|
48 | - public function __construct($path, $lockType, $code = 0, \Exception $previous = null) { |
|
49 | - $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', array($lockType, $path)); |
|
50 | - parent::__construct($message, $code, $previous); |
|
51 | - } |
|
45 | + /** |
|
46 | + * @since 7.0.0 |
|
47 | + */ |
|
48 | + public function __construct($path, $lockType, $code = 0, \Exception $previous = null) { |
|
49 | + $message = \OC::$server->getL10N('core')->t('Could not obtain lock type %d on "%s".', array($lockType, $path)); |
|
50 | + parent::__construct($message, $code, $previous); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * custom string representation of object |
|
55 | - * |
|
56 | - * @return string |
|
57 | - * @since 7.0.0 |
|
58 | - */ |
|
59 | - public function __toString() { |
|
60 | - return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; |
|
61 | - } |
|
53 | + /** |
|
54 | + * custom string representation of object |
|
55 | + * |
|
56 | + * @return string |
|
57 | + * @since 7.0.0 |
|
58 | + */ |
|
59 | + public function __toString() { |
|
60 | + return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; |
|
61 | + } |
|
62 | 62 | } |
@@ -57,6 +57,6 @@ |
||
57 | 57 | * @since 7.0.0 |
58 | 58 | */ |
59 | 59 | public function __toString() { |
60 | - return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; |
|
60 | + return __CLASS__.": [{$this->code}]: {$this->message}\n"; |
|
61 | 61 | } |
62 | 62 | } |
@@ -31,36 +31,36 @@ |
||
31 | 31 | * @since 9.1.0 |
32 | 32 | */ |
33 | 33 | interface INotifyStorage { |
34 | - const NOTIFY_ADDED = 1; |
|
35 | - const NOTIFY_REMOVED = 2; |
|
36 | - const NOTIFY_MODIFIED = 3; |
|
37 | - const NOTIFY_RENAMED = 4; |
|
34 | + const NOTIFY_ADDED = 1; |
|
35 | + const NOTIFY_REMOVED = 2; |
|
36 | + const NOTIFY_MODIFIED = 3; |
|
37 | + const NOTIFY_RENAMED = 4; |
|
38 | 38 | |
39 | - /** |
|
40 | - * Start listening for update notifications |
|
41 | - * |
|
42 | - * The provided callback will be called for every incoming notification with the following parameters |
|
43 | - * - int $type the type of update, one of the INotifyStorage::NOTIFY_* constants |
|
44 | - * - string $path the path of the update |
|
45 | - * - string $renameTarget the target of the rename operation, only provided for rename updates |
|
46 | - * |
|
47 | - * Note that this call is blocking and will not exit on it's own, to stop listening for notifications return `false` from the callback |
|
48 | - * |
|
49 | - * @param string $path |
|
50 | - * @param callable $callback |
|
51 | - * |
|
52 | - * @since 9.1.0 |
|
53 | - * @deprecated 12.0.0 use INotifyStorage::notify()->listen() instead |
|
54 | - */ |
|
55 | - public function listen($path, callable $callback); |
|
39 | + /** |
|
40 | + * Start listening for update notifications |
|
41 | + * |
|
42 | + * The provided callback will be called for every incoming notification with the following parameters |
|
43 | + * - int $type the type of update, one of the INotifyStorage::NOTIFY_* constants |
|
44 | + * - string $path the path of the update |
|
45 | + * - string $renameTarget the target of the rename operation, only provided for rename updates |
|
46 | + * |
|
47 | + * Note that this call is blocking and will not exit on it's own, to stop listening for notifications return `false` from the callback |
|
48 | + * |
|
49 | + * @param string $path |
|
50 | + * @param callable $callback |
|
51 | + * |
|
52 | + * @since 9.1.0 |
|
53 | + * @deprecated 12.0.0 use INotifyStorage::notify()->listen() instead |
|
54 | + */ |
|
55 | + public function listen($path, callable $callback); |
|
56 | 56 | |
57 | - /** |
|
58 | - * Start the notification handler for this storage |
|
59 | - * |
|
60 | - * @param $path |
|
61 | - * @return INotifyHandler |
|
62 | - * |
|
63 | - * @since 12.0.0 |
|
64 | - */ |
|
65 | - public function notify($path); |
|
57 | + /** |
|
58 | + * Start the notification handler for this storage |
|
59 | + * |
|
60 | + * @param $path |
|
61 | + * @return INotifyHandler |
|
62 | + * |
|
63 | + * @since 12.0.0 |
|
64 | + */ |
|
65 | + public function notify($path); |
|
66 | 66 | } |
@@ -30,25 +30,25 @@ |
||
30 | 30 | * @since 8.0.0 |
31 | 31 | */ |
32 | 32 | interface IStorageFactory { |
33 | - /** |
|
34 | - * allow modifier storage behaviour by adding wrappers around storages |
|
35 | - * |
|
36 | - * $callback should be a function of type (string $mountPoint, Storage $storage) => Storage |
|
37 | - * |
|
38 | - * @param string $wrapperName |
|
39 | - * @param callable $callback |
|
40 | - * @return bool true if the wrapper was added, false if there was already a wrapper with this |
|
41 | - * name registered |
|
42 | - * @since 8.0.0 |
|
43 | - */ |
|
44 | - public function addStorageWrapper($wrapperName, $callback); |
|
33 | + /** |
|
34 | + * allow modifier storage behaviour by adding wrappers around storages |
|
35 | + * |
|
36 | + * $callback should be a function of type (string $mountPoint, Storage $storage) => Storage |
|
37 | + * |
|
38 | + * @param string $wrapperName |
|
39 | + * @param callable $callback |
|
40 | + * @return bool true if the wrapper was added, false if there was already a wrapper with this |
|
41 | + * name registered |
|
42 | + * @since 8.0.0 |
|
43 | + */ |
|
44 | + public function addStorageWrapper($wrapperName, $callback); |
|
45 | 45 | |
46 | - /** |
|
47 | - * @param \OCP\Files\Mount\IMountPoint $mountPoint |
|
48 | - * @param string $class |
|
49 | - * @param array $arguments |
|
50 | - * @return \OCP\Files\Storage |
|
51 | - * @since 8.0.0 |
|
52 | - */ |
|
53 | - public function getInstance(IMountPoint $mountPoint, $class, $arguments); |
|
46 | + /** |
|
47 | + * @param \OCP\Files\Mount\IMountPoint $mountPoint |
|
48 | + * @param string $class |
|
49 | + * @param array $arguments |
|
50 | + * @return \OCP\Files\Storage |
|
51 | + * @since 8.0.0 |
|
52 | + */ |
|
53 | + public function getInstance(IMountPoint $mountPoint, $class, $arguments); |
|
54 | 54 | } |