aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Files
Commit message (Collapse)AuthorAgeFilesLines
* Properly add new methods to interface and document in PHPDoc for getRootMounts()Morris Jobke2020-08-172-1/+9
| | | | | | Introduced in #22063 and was just forgotten. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Distribute preview folders in appdata in multibucket setup to multiple bucketsMorris Jobke2020-08-061-0/+41
| | | | | | | | | * introduces a new IRootMountProvider to register mount points inside the root storage * adds a AppdataPreviewObjectStoreStorage to handle the split between preview folders and bucket number Ref #22033 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add lazy events for the Node APIRoeland Jago Douma2020-05-2815-0/+530
| | | | | | | | | | | Right now if you want to get events via the Node API you have to have a real instance of the Root. Which in turns sets up the whole FS. We should make sure this is done lazy. Else enabling the preview generator for example makes you setup the whole FS on each and every authenticated call. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headers for 19Christoph Wurst2020-04-2923-0/+23
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all constantsChristoph Wurst2020-04-1011-47/+47
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-1024-25/+17
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-095-1/+4
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Properly hint exceptions thrown by getUserFolderJulius Härtl2020-04-031-0/+4
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-313-0/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* allow writing content directly when creating new SimpleFileRobin Appelman2020-02-282-2/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Create SimpleFile only when writing the contentRobin Appelman2020-02-281-1/+2
| | | | | | | | | | | | | | | | | | | | instead of first creating an empty file and then writing the content. This solves the overhead of creating an empty file with the common pattern: ```php $file = $simpleFilder->newFile('foo.txt'); $file->putContent('bar.txt'); ``` roughly halving the number of storage and database operations that need to be done when creating a `SimpleFile`. This is not automatically done with `File` because that has a more complex api which I'm more hesitant to touch. Instead the `Folder::newFile` api has been extended to accept the content for the new file. In my local testing, the overhead of first creating an empty file took about 20% of the time for preview generation Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow to overwrite the path on the cache eventJoas Schilling2020-02-131-0/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update license headers for 18Christoph Wurst2019-12-208-14/+22
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add typed events for the filesystem/scannerChristoph Wurst2019-12-137-0/+434
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Allow to check for the mimetype by content onlyJoas Schilling2019-12-101-1/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update license headersChristoph Wurst2019-12-0568-79/+139
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* add @since to limitToHomeRobin Appelman2019-12-031-0/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow filtering the search results to the users home storageRobin Appelman2019-12-031-0/+7
| | | | | | | | | | | | | | | | | | | | This is done by adding a ```xml <d:eq> <d:prop> <oc:owner-id/> </d:prop> <d:literal>$userId</d:literal> </d:eq> ``` clause to the search query. Searching by `owner-id` can only be done with the current user id and the comparison can not be inside a `<d:not>` or `<d:or>` statement Signed-off-by: Robin Appelman <robin@icewind.nl>
* Properly anotate LockedException in files node apiJulius Härtl2019-11-282-13/+29
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Some php-cs fixesRoeland Jago Douma2019-11-2236-4/+34
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* dont expose metadata etag for nowRobin Appelman2019-11-131-10/+0
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* expose filecache extension data in FileInfoRobin Appelman2019-11-131-0/+36
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* store filecache extension fieldsRobin Appelman2019-11-131-0/+24
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Remove deprecated searchByTagRoeland Jago Douma2019-07-261-13/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Harden appdata putcontentRoeland Jago Douma2019-04-081-0/+1
| | | | | | | If for whatever reason appdata got into a strange state this will at least propegate up and not make it do boom the next run. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* add option to get raw size (without submounts) from fileinfoRobin Appelman2019-02-272-2/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* add event for cache updateRobin Appelman2019-02-183-44/+83
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #13748 from nextcloud/cache-insert-eventMorris Jobke2019-02-071-0/+72
|\ | | | | add event for inserting cache entries
| * add event for inserting cache entriesRobin Appelman2019-02-071-0/+72
| | | | | | | | | | | | | | | | this provides a reliable way for apps to listen to new files without the need to of cache wrappers to hook into inserts themselves (something which isn't 100% reliable) Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Add since labelsMorris Jobke2019-02-071-0/+13
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Implement guest avatar endpointMichael Weimann2019-02-071-0/+137
|/ | | | Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
* Add objectExists to objectstore interfaceRobin Appelman2018-12-121-0/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add interface to allow storages from opting out of encryptionRobin Appelman2018-11-291-0/+31
| | | | | | As opposed to hard-coding a list of excluded storages Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add PHPDoc for thrown exceptionMorris Jobke2018-11-191-0/+3
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix string doc type casingChristoph Wurst2018-11-151-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* extend storage api to allow directly writing a stream to storageRobin Appelman2018-10-311-0/+40
| | | | | | | | | | | this removes the need for temporary storages with some external storage backends. The new method is added to a separate interface to maintain compatibility with storage backends implementing the storage interface directly (without inheriting common) Currently the interface is implemented for objectstorage based storages and local storage and used by webdav uploads Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add getExtension() to FileInfoRobin Appelman2018-10-292-0/+16
| | | | | | | this is a fairly common operation so it makes sense to prevent having to repeatedly implement it. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #10179 from nextcloud/mount-filterMorris Jobke2018-07-111-0/+8
|\ | | | | Add the option to filter mounts for a user
| * Add the option to filter mounts for a userRobin Appelman2018-07-101-0/+8
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Separate fopen into read and write methodsJulius Härtl2018-07-111-2/+11
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Add fopen method to ISimpleFileJulius Härtl2018-07-111-0/+9
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Add resource type phpDoc for putContent methodsJulius Härtl2018-06-262-2/+2
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Make Appdata staticRoeland Jago Douma2018-05-141-3/+3
| | | | | | * Add fileid for simpleroot folders (only internal) Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix testsRoeland Jago Douma2018-04-041-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make the MountManager strictRoeland Jago Douma2018-04-041-7/+8
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Throw an exception if file_put_contents failsRoeland Jago Douma2018-03-272-1/+34
| | | | | | | | * This will help with AppData hardening etc * Introduced a GenericFileException for if nothing else is appropiate - Maybe the other File exceptions should base on this? Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add hint about OCP\Folder::getByIdMorris Jobke2018-03-211-0/+3
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Hardening of SimpleFile getContentRoeland Jago Douma2018-02-271-0/+3
| | | | | | | if file_get_contents fails remove the file. And traverse up the tree checking if the other folders are there. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix filename typoRobin Appelman2017-12-121-0/+0
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>