@@ -32,37 +32,37 @@ |
||
32 | 32 | * checksum name. |
33 | 33 | */ |
34 | 34 | class ChecksumList implements XmlSerializable { |
35 | - public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
35 | + public const NS_OWNCLOUD = 'http://owncloud.org/ns'; |
|
36 | 36 | |
37 | - /** @var string[] of TYPE:CHECKSUM */ |
|
38 | - private array $checksums; |
|
37 | + /** @var string[] of TYPE:CHECKSUM */ |
|
38 | + private array $checksums; |
|
39 | 39 | |
40 | - public function __construct(string $checksum) { |
|
41 | - $this->checksums = explode(' ', $checksum); |
|
42 | - } |
|
40 | + public function __construct(string $checksum) { |
|
41 | + $this->checksums = explode(' ', $checksum); |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * The xmlSerialize method is called during xml writing. |
|
46 | - * |
|
47 | - * Use the $writer argument to write its own xml serialization. |
|
48 | - * |
|
49 | - * An important note: do _not_ create a parent element. Any element |
|
50 | - * implementing XmlSerializble should only ever write what's considered |
|
51 | - * its 'inner xml'. |
|
52 | - * |
|
53 | - * The parent of the current element is responsible for writing a |
|
54 | - * containing element. |
|
55 | - * |
|
56 | - * This allows serializers to be re-used for different element names. |
|
57 | - * |
|
58 | - * If you are opening new elements, you must also close them again. |
|
59 | - * |
|
60 | - * @param Writer $writer |
|
61 | - * @return void |
|
62 | - */ |
|
63 | - public function xmlSerialize(Writer $writer) { |
|
64 | - foreach ($this->checksums as $checksum) { |
|
65 | - $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum); |
|
66 | - } |
|
67 | - } |
|
44 | + /** |
|
45 | + * The xmlSerialize method is called during xml writing. |
|
46 | + * |
|
47 | + * Use the $writer argument to write its own xml serialization. |
|
48 | + * |
|
49 | + * An important note: do _not_ create a parent element. Any element |
|
50 | + * implementing XmlSerializble should only ever write what's considered |
|
51 | + * its 'inner xml'. |
|
52 | + * |
|
53 | + * The parent of the current element is responsible for writing a |
|
54 | + * containing element. |
|
55 | + * |
|
56 | + * This allows serializers to be re-used for different element names. |
|
57 | + * |
|
58 | + * If you are opening new elements, you must also close them again. |
|
59 | + * |
|
60 | + * @param Writer $writer |
|
61 | + * @return void |
|
62 | + */ |
|
63 | + public function xmlSerialize(Writer $writer) { |
|
64 | + foreach ($this->checksums as $checksum) { |
|
65 | + $writer->writeElement('{' . self::NS_OWNCLOUD . '}checksum', $checksum); |
|
66 | + } |
|
67 | + } |
|
68 | 68 | } |
@@ -36,267 +36,267 @@ |
||
36 | 36 | * @since 7.0.0 |
37 | 37 | */ |
38 | 38 | interface FileInfo { |
39 | - /** |
|
40 | - * @since 7.0.0 |
|
41 | - */ |
|
42 | - public const TYPE_FILE = 'file'; |
|
43 | - /** |
|
44 | - * @since 7.0.0 |
|
45 | - */ |
|
46 | - public const TYPE_FOLDER = 'dir'; |
|
39 | + /** |
|
40 | + * @since 7.0.0 |
|
41 | + */ |
|
42 | + public const TYPE_FILE = 'file'; |
|
43 | + /** |
|
44 | + * @since 7.0.0 |
|
45 | + */ |
|
46 | + public const TYPE_FOLDER = 'dir'; |
|
47 | 47 | |
48 | - /** |
|
49 | - * @const \OCP\Files\FileInfo::SPACE_NOT_COMPUTED Return value for a not computed space value |
|
50 | - * @since 8.0.0 |
|
51 | - */ |
|
52 | - public const SPACE_NOT_COMPUTED = -1; |
|
53 | - /** |
|
54 | - * @const \OCP\Files\FileInfo::SPACE_UNKNOWN Return value for unknown space value |
|
55 | - * @since 8.0.0 |
|
56 | - */ |
|
57 | - public const SPACE_UNKNOWN = -2; |
|
58 | - /** |
|
59 | - * @const \OCP\Files\FileInfo::SPACE_UNLIMITED Return value for unlimited space |
|
60 | - * @since 8.0.0 |
|
61 | - */ |
|
62 | - public const SPACE_UNLIMITED = -3; |
|
48 | + /** |
|
49 | + * @const \OCP\Files\FileInfo::SPACE_NOT_COMPUTED Return value for a not computed space value |
|
50 | + * @since 8.0.0 |
|
51 | + */ |
|
52 | + public const SPACE_NOT_COMPUTED = -1; |
|
53 | + /** |
|
54 | + * @const \OCP\Files\FileInfo::SPACE_UNKNOWN Return value for unknown space value |
|
55 | + * @since 8.0.0 |
|
56 | + */ |
|
57 | + public const SPACE_UNKNOWN = -2; |
|
58 | + /** |
|
59 | + * @const \OCP\Files\FileInfo::SPACE_UNLIMITED Return value for unlimited space |
|
60 | + * @since 8.0.0 |
|
61 | + */ |
|
62 | + public const SPACE_UNLIMITED = -3; |
|
63 | 63 | |
64 | - /** |
|
65 | - * @since 9.1.0 |
|
66 | - */ |
|
67 | - public const MIMETYPE_FOLDER = 'httpd/unix-directory'; |
|
64 | + /** |
|
65 | + * @since 9.1.0 |
|
66 | + */ |
|
67 | + public const MIMETYPE_FOLDER = 'httpd/unix-directory'; |
|
68 | 68 | |
69 | - /** |
|
70 | - * @const \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX Return regular expression to test filenames against (blacklisting) |
|
71 | - * @since 12.0.0 |
|
72 | - */ |
|
73 | - public const BLACKLIST_FILES_REGEX = '\.(part|filepart)$'; |
|
69 | + /** |
|
70 | + * @const \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX Return regular expression to test filenames against (blacklisting) |
|
71 | + * @since 12.0.0 |
|
72 | + */ |
|
73 | + public const BLACKLIST_FILES_REGEX = '\.(part|filepart)$'; |
|
74 | 74 | |
75 | - /** |
|
76 | - * Get the Etag of the file or folder |
|
77 | - * |
|
78 | - * @return string |
|
79 | - * @since 7.0.0 |
|
80 | - */ |
|
81 | - public function getEtag(); |
|
75 | + /** |
|
76 | + * Get the Etag of the file or folder |
|
77 | + * |
|
78 | + * @return string |
|
79 | + * @since 7.0.0 |
|
80 | + */ |
|
81 | + public function getEtag(); |
|
82 | 82 | |
83 | - /** |
|
84 | - * Get the size in bytes for the file or folder |
|
85 | - * |
|
86 | - * @param bool $includeMounts whether or not to include the size of any sub mounts, since 16.0.0 |
|
87 | - * @return int |
|
88 | - * @since 7.0.0 |
|
89 | - */ |
|
90 | - public function getSize($includeMounts = true); |
|
83 | + /** |
|
84 | + * Get the size in bytes for the file or folder |
|
85 | + * |
|
86 | + * @param bool $includeMounts whether or not to include the size of any sub mounts, since 16.0.0 |
|
87 | + * @return int |
|
88 | + * @since 7.0.0 |
|
89 | + */ |
|
90 | + public function getSize($includeMounts = true); |
|
91 | 91 | |
92 | - /** |
|
93 | - * Get the last modified date as timestamp for the file or folder |
|
94 | - * |
|
95 | - * @return int |
|
96 | - * @since 7.0.0 |
|
97 | - */ |
|
98 | - public function getMtime(); |
|
92 | + /** |
|
93 | + * Get the last modified date as timestamp for the file or folder |
|
94 | + * |
|
95 | + * @return int |
|
96 | + * @since 7.0.0 |
|
97 | + */ |
|
98 | + public function getMtime(); |
|
99 | 99 | |
100 | - /** |
|
101 | - * Get the name of the file or folder |
|
102 | - * |
|
103 | - * @return string |
|
104 | - * @since 7.0.0 |
|
105 | - */ |
|
106 | - public function getName(); |
|
100 | + /** |
|
101 | + * Get the name of the file or folder |
|
102 | + * |
|
103 | + * @return string |
|
104 | + * @since 7.0.0 |
|
105 | + */ |
|
106 | + public function getName(); |
|
107 | 107 | |
108 | - /** |
|
109 | - * Get the path relative to the storage |
|
110 | - * |
|
111 | - * @return string |
|
112 | - * @since 7.0.0 |
|
113 | - */ |
|
114 | - public function getInternalPath(); |
|
108 | + /** |
|
109 | + * Get the path relative to the storage |
|
110 | + * |
|
111 | + * @return string |
|
112 | + * @since 7.0.0 |
|
113 | + */ |
|
114 | + public function getInternalPath(); |
|
115 | 115 | |
116 | - /** |
|
117 | - * Get the absolute path |
|
118 | - * |
|
119 | - * @return string |
|
120 | - * @since 7.0.0 |
|
121 | - */ |
|
122 | - public function getPath(); |
|
116 | + /** |
|
117 | + * Get the absolute path |
|
118 | + * |
|
119 | + * @return string |
|
120 | + * @since 7.0.0 |
|
121 | + */ |
|
122 | + public function getPath(); |
|
123 | 123 | |
124 | - /** |
|
125 | - * Get the full mimetype of the file or folder i.e. 'image/png' |
|
126 | - * |
|
127 | - * @return string |
|
128 | - * @since 7.0.0 |
|
129 | - */ |
|
130 | - public function getMimetype(); |
|
124 | + /** |
|
125 | + * Get the full mimetype of the file or folder i.e. 'image/png' |
|
126 | + * |
|
127 | + * @return string |
|
128 | + * @since 7.0.0 |
|
129 | + */ |
|
130 | + public function getMimetype(); |
|
131 | 131 | |
132 | - /** |
|
133 | - * Get the first part of the mimetype of the file or folder i.e. 'image' |
|
134 | - * |
|
135 | - * @return string |
|
136 | - * @since 7.0.0 |
|
137 | - */ |
|
138 | - public function getMimePart(); |
|
132 | + /** |
|
133 | + * Get the first part of the mimetype of the file or folder i.e. 'image' |
|
134 | + * |
|
135 | + * @return string |
|
136 | + * @since 7.0.0 |
|
137 | + */ |
|
138 | + public function getMimePart(); |
|
139 | 139 | |
140 | - /** |
|
141 | - * Get the storage the file or folder is storage on |
|
142 | - * |
|
143 | - * @return IStorage |
|
144 | - * @since 7.0.0 |
|
145 | - */ |
|
146 | - public function getStorage(); |
|
140 | + /** |
|
141 | + * Get the storage the file or folder is storage on |
|
142 | + * |
|
143 | + * @return IStorage |
|
144 | + * @since 7.0.0 |
|
145 | + */ |
|
146 | + public function getStorage(); |
|
147 | 147 | |
148 | - /** |
|
149 | - * Get the file id of the file or folder |
|
150 | - * |
|
151 | - * @return int|null |
|
152 | - * @since 7.0.0 |
|
153 | - */ |
|
154 | - public function getId(); |
|
148 | + /** |
|
149 | + * Get the file id of the file or folder |
|
150 | + * |
|
151 | + * @return int|null |
|
152 | + * @since 7.0.0 |
|
153 | + */ |
|
154 | + public function getId(); |
|
155 | 155 | |
156 | - /** |
|
157 | - * Check whether the file is encrypted |
|
158 | - * |
|
159 | - * @return bool |
|
160 | - * @since 7.0.0 |
|
161 | - */ |
|
162 | - public function isEncrypted(); |
|
156 | + /** |
|
157 | + * Check whether the file is encrypted |
|
158 | + * |
|
159 | + * @return bool |
|
160 | + * @since 7.0.0 |
|
161 | + */ |
|
162 | + public function isEncrypted(); |
|
163 | 163 | |
164 | - /** |
|
165 | - * Get the permissions of the file or folder as bitmasked combination of the following constants |
|
166 | - * \OCP\Constants::PERMISSION_CREATE |
|
167 | - * \OCP\Constants::PERMISSION_READ |
|
168 | - * \OCP\Constants::PERMISSION_UPDATE |
|
169 | - * \OCP\Constants::PERMISSION_DELETE |
|
170 | - * \OCP\Constants::PERMISSION_SHARE |
|
171 | - * \OCP\Constants::PERMISSION_ALL |
|
172 | - * |
|
173 | - * @return int |
|
174 | - * @since 7.0.0 - namespace of constants has changed in 8.0.0 |
|
175 | - */ |
|
176 | - public function getPermissions(); |
|
164 | + /** |
|
165 | + * Get the permissions of the file or folder as bitmasked combination of the following constants |
|
166 | + * \OCP\Constants::PERMISSION_CREATE |
|
167 | + * \OCP\Constants::PERMISSION_READ |
|
168 | + * \OCP\Constants::PERMISSION_UPDATE |
|
169 | + * \OCP\Constants::PERMISSION_DELETE |
|
170 | + * \OCP\Constants::PERMISSION_SHARE |
|
171 | + * \OCP\Constants::PERMISSION_ALL |
|
172 | + * |
|
173 | + * @return int |
|
174 | + * @since 7.0.0 - namespace of constants has changed in 8.0.0 |
|
175 | + */ |
|
176 | + public function getPermissions(); |
|
177 | 177 | |
178 | - /** |
|
179 | - * Check whether this is a file or a folder |
|
180 | - * |
|
181 | - * @return string \OCP\Files\FileInfo::TYPE_FILE|\OCP\Files\FileInfo::TYPE_FOLDER |
|
182 | - * @since 7.0.0 |
|
183 | - */ |
|
184 | - public function getType(); |
|
178 | + /** |
|
179 | + * Check whether this is a file or a folder |
|
180 | + * |
|
181 | + * @return string \OCP\Files\FileInfo::TYPE_FILE|\OCP\Files\FileInfo::TYPE_FOLDER |
|
182 | + * @since 7.0.0 |
|
183 | + */ |
|
184 | + public function getType(); |
|
185 | 185 | |
186 | - /** |
|
187 | - * Check if the file or folder is readable |
|
188 | - * |
|
189 | - * @return bool |
|
190 | - * @since 7.0.0 |
|
191 | - */ |
|
192 | - public function isReadable(); |
|
186 | + /** |
|
187 | + * Check if the file or folder is readable |
|
188 | + * |
|
189 | + * @return bool |
|
190 | + * @since 7.0.0 |
|
191 | + */ |
|
192 | + public function isReadable(); |
|
193 | 193 | |
194 | - /** |
|
195 | - * Check if a file is writable |
|
196 | - * |
|
197 | - * @return bool |
|
198 | - * @since 7.0.0 |
|
199 | - */ |
|
200 | - public function isUpdateable(); |
|
194 | + /** |
|
195 | + * Check if a file is writable |
|
196 | + * |
|
197 | + * @return bool |
|
198 | + * @since 7.0.0 |
|
199 | + */ |
|
200 | + public function isUpdateable(); |
|
201 | 201 | |
202 | - /** |
|
203 | - * Check whether new files or folders can be created inside this folder |
|
204 | - * |
|
205 | - * @return bool |
|
206 | - * @since 8.0.0 |
|
207 | - */ |
|
208 | - public function isCreatable(); |
|
202 | + /** |
|
203 | + * Check whether new files or folders can be created inside this folder |
|
204 | + * |
|
205 | + * @return bool |
|
206 | + * @since 8.0.0 |
|
207 | + */ |
|
208 | + public function isCreatable(); |
|
209 | 209 | |
210 | - /** |
|
211 | - * Check if a file or folder can be deleted |
|
212 | - * |
|
213 | - * @return bool |
|
214 | - * @since 7.0.0 |
|
215 | - */ |
|
216 | - public function isDeletable(); |
|
210 | + /** |
|
211 | + * Check if a file or folder can be deleted |
|
212 | + * |
|
213 | + * @return bool |
|
214 | + * @since 7.0.0 |
|
215 | + */ |
|
216 | + public function isDeletable(); |
|
217 | 217 | |
218 | - /** |
|
219 | - * Check if a file or folder can be shared |
|
220 | - * |
|
221 | - * @return bool |
|
222 | - * @since 7.0.0 |
|
223 | - */ |
|
224 | - public function isShareable(); |
|
218 | + /** |
|
219 | + * Check if a file or folder can be shared |
|
220 | + * |
|
221 | + * @return bool |
|
222 | + * @since 7.0.0 |
|
223 | + */ |
|
224 | + public function isShareable(); |
|
225 | 225 | |
226 | - /** |
|
227 | - * Check if a file or folder is shared |
|
228 | - * |
|
229 | - * @return bool |
|
230 | - * @since 7.0.0 |
|
231 | - */ |
|
232 | - public function isShared(); |
|
226 | + /** |
|
227 | + * Check if a file or folder is shared |
|
228 | + * |
|
229 | + * @return bool |
|
230 | + * @since 7.0.0 |
|
231 | + */ |
|
232 | + public function isShared(); |
|
233 | 233 | |
234 | - /** |
|
235 | - * Check if a file or folder is mounted |
|
236 | - * |
|
237 | - * @return bool |
|
238 | - * @since 7.0.0 |
|
239 | - */ |
|
240 | - public function isMounted(); |
|
234 | + /** |
|
235 | + * Check if a file or folder is mounted |
|
236 | + * |
|
237 | + * @return bool |
|
238 | + * @since 7.0.0 |
|
239 | + */ |
|
240 | + public function isMounted(); |
|
241 | 241 | |
242 | - /** |
|
243 | - * Get the mountpoint the file belongs to |
|
244 | - * |
|
245 | - * @return \OCP\Files\Mount\IMountPoint |
|
246 | - * @since 8.0.0 |
|
247 | - */ |
|
248 | - public function getMountPoint(); |
|
242 | + /** |
|
243 | + * Get the mountpoint the file belongs to |
|
244 | + * |
|
245 | + * @return \OCP\Files\Mount\IMountPoint |
|
246 | + * @since 8.0.0 |
|
247 | + */ |
|
248 | + public function getMountPoint(); |
|
249 | 249 | |
250 | - /** |
|
251 | - * Get the owner of the file |
|
252 | - * |
|
253 | - * @return \OCP\IUser |
|
254 | - * @since 9.0.0 |
|
255 | - */ |
|
256 | - public function getOwner(); |
|
250 | + /** |
|
251 | + * Get the owner of the file |
|
252 | + * |
|
253 | + * @return \OCP\IUser |
|
254 | + * @since 9.0.0 |
|
255 | + */ |
|
256 | + public function getOwner(); |
|
257 | 257 | |
258 | - /** |
|
259 | - * Get the stored checksum(s) for this file |
|
260 | - * |
|
261 | - * Checksums are stored in the format TYPE:CHECKSUM, here may be multiple checksums separated by a single space |
|
262 | - * e.g. MD5:d3b07384d113edec49eaa6238ad5ff00 SHA1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 |
|
263 | - * |
|
264 | - * @return string |
|
265 | - * @since 9.0.0 |
|
266 | - */ |
|
267 | - public function getChecksum(); |
|
258 | + /** |
|
259 | + * Get the stored checksum(s) for this file |
|
260 | + * |
|
261 | + * Checksums are stored in the format TYPE:CHECKSUM, here may be multiple checksums separated by a single space |
|
262 | + * e.g. MD5:d3b07384d113edec49eaa6238ad5ff00 SHA1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 |
|
263 | + * |
|
264 | + * @return string |
|
265 | + * @since 9.0.0 |
|
266 | + */ |
|
267 | + public function getChecksum(); |
|
268 | 268 | |
269 | - /** |
|
270 | - * Get the extension of the file |
|
271 | - * |
|
272 | - * @return string |
|
273 | - * @since 15.0.0 |
|
274 | - */ |
|
275 | - public function getExtension(): string; |
|
269 | + /** |
|
270 | + * Get the extension of the file |
|
271 | + * |
|
272 | + * @return string |
|
273 | + * @since 15.0.0 |
|
274 | + */ |
|
275 | + public function getExtension(): string; |
|
276 | 276 | |
277 | - /** |
|
278 | - * Get the creation date as unix timestamp |
|
279 | - * |
|
280 | - * If the creation time is not known, 0 will be returned |
|
281 | - * |
|
282 | - * creation time is not set automatically by the server and is generally only available |
|
283 | - * for files uploaded by the sync clients |
|
284 | - * |
|
285 | - * @return int |
|
286 | - * @since 18.0.0 |
|
287 | - */ |
|
288 | - public function getCreationTime(): int; |
|
277 | + /** |
|
278 | + * Get the creation date as unix timestamp |
|
279 | + * |
|
280 | + * If the creation time is not known, 0 will be returned |
|
281 | + * |
|
282 | + * creation time is not set automatically by the server and is generally only available |
|
283 | + * for files uploaded by the sync clients |
|
284 | + * |
|
285 | + * @return int |
|
286 | + * @since 18.0.0 |
|
287 | + */ |
|
288 | + public function getCreationTime(): int; |
|
289 | 289 | |
290 | - /** |
|
291 | - * Get the upload date as unix timestamp |
|
292 | - * |
|
293 | - * If the upload time is not known, 0 will be returned |
|
294 | - * |
|
295 | - * Upload time will be set automatically by the server for files uploaded over DAV |
|
296 | - * files created by Nextcloud apps generally do not have an the upload time set |
|
297 | - * |
|
298 | - * @return int |
|
299 | - * @since 18.0.0 |
|
300 | - */ |
|
301 | - public function getUploadTime(): int; |
|
290 | + /** |
|
291 | + * Get the upload date as unix timestamp |
|
292 | + * |
|
293 | + * If the upload time is not known, 0 will be returned |
|
294 | + * |
|
295 | + * Upload time will be set automatically by the server for files uploaded over DAV |
|
296 | + * files created by Nextcloud apps generally do not have an the upload time set |
|
297 | + * |
|
298 | + * @return int |
|
299 | + * @since 18.0.0 |
|
300 | + */ |
|
301 | + public function getUploadTime(): int; |
|
302 | 302 | } |