summaryrefslogtreecommitdiffstats
path: root/lib/private/Files
Commit message (Collapse)AuthorAgeFilesLines
* Fix file size computation on 32bit platformsaler92020-12-021-5/+4
| | | | Signed-off-by: aler9 <46489434+aler9@users.noreply.github.com>
* Extra white space to follow other ifslui87kw2020-11-251-1/+1
| | | | Signed-off-by: lui87kw <lukas.ifflaender@uni-wuerzburg.de>
* Avoid substr() error when strpos returns falsebladewing2020-11-251-6/+9
| | | | | | | | "Exception: substr() expects parameter 3 to be int, bool given" can occur on Line 378 $mimePart = substr($icon, 0, strpos($icon, '-')); This happens, when '-' is not found and strpos returns false instead of an int. When this occurs, e.g., Activity hangs. Signed-off-by: lui87kw <lukas.ifflaender@uni-wuerzburg.de>
* Unlock when promoting to exclusive lock failsAshod Nakashian2020-11-121-1/+7
| | | | | | | | | | | | | | | | In certain cases changeLock to EXCLUSIVE fails and throws LockedException. This leaves the file locked as SHARED in file_put_contents, which prevents retrying (because on second call file_put_contents takes another SHARED lock on the same file, and changeLock doesn't allow more than a single SHARED lock to promote to EXCLUSIVE). To avoid this case, we catch the LockedException and unlock before re-throwing. Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
* Make sure root storage is valid before checking its sizeJohn Molakvoæ (skjnldsv)2020-11-091-1/+4
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Transfer shares of the transferred root nodeJulius Härtl2020-09-171-0/+5
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* fix: file quota was not applied in all caseskorelstar2020-09-171-2/+2
|
* Fix reading empty files from objectstorageRoeland Jago Douma2020-09-091-0/+5
| | | | | | | | Since we try to do range requests this will fail hard. However since empty files are not that interesting to read anyways we just read from an emptry memory stream. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Properly add both mimetypes to secure mimetype mappingJulius Härtl2020-09-091-1/+7
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #22519 from nextcloud/backport/22517/stable19Julius Härtl2020-08-311-1/+1
|\ | | | | [stable19] set the mount id before calling storage wrapper
| * set the mount id before calling storage wrapperRobin Appelman2020-08-311-1/+1
| | | | | | | | | | | | this allows the storage wrapper to use the mount id for it's own logic Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Only update the filecache entry once the file has been written to S3Roeland Jago Douma2020-08-311-2/+11
| | | | | | | | | | | | | | If we already update before we have no way to revert if the upload fails. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Don't lose filecache entry on s3 overwrite errorRoeland Jago Douma2020-08-311-5/+16
|/ | | | | | | If the object store errors we should not always delete the filecache entry. As this might lead to people losing access to their files. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Make legacy cipher opt inRoeland Jago Douma2020-08-241-0/+1
| | | | | | | | * Systems that upgrade have this enabled by default * New systems disable it * We'll have to add some wargning in the setup checks if this is enabled Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #21983 from nextcloud/backport/21628/stable19Morris Jobke2020-08-193-18/+36
|\ | | | | [stable19] fix moving files from external storage to object store trashbin
| * dont update mimetype when moving to trashRobin Appelman2020-07-311-1/+5
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * fix renameFromStorage messing with folder mimetypeRobin Appelman2020-07-231-7/+10
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * use exceptions for error signaling in writeStreamRobin Appelman2020-07-232-5/+19
| | | | | | | | | | | | this remove the ambiguity when writing zero length files Signed-off-by: Robin Appelman <robin@icewind.nl>
| * fix moving files from external storage to object store trashbinRobin Appelman2020-07-231-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | having the "cache rename" after the "storage move" caused the target to get the fileid from the source file, without taking care that the object is stored under the original file id. By doing the "cache rename" first, we trigger the "update existing file" logic while moving the file to the object store and the object gets stored for the correct file id Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Only clear the realpath cacheJ0WI2020-08-121-2/+2
| | | | | | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* | clearstatcache() on rmdirJ0WI2020-08-121-0/+2
|/ | | | Signed-off-by: J0WI <J0WI@users.noreply.github.com>
* ensure home storage is initialized on first setupRobin Appelman2020-07-093-2/+6
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix static method call for s3 bucket compat checkChristoph Wurst2020-07-031-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #21573 from nextcloud/backport/21558/stable19Morris Jobke2020-07-021-7/+3
|\ | | | | [stable19] relax permissions mask check for detecting part file rename
| * relax permissions mask check for detecting part file renameRobin Appelman2020-06-241-7/+3
| | | | | | | | | | | | with files drop uploads the original file name isn't always used for the '.ocTransferId' source path Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Update presign method to match with interface again.Daniel Kesselberg2020-06-301-1/+2
|/ | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Disable Client-Side Monitoring on AWS storageChristoph Wurst2020-06-171-2/+3
| | | | | | | | | The S3 client enables this by default and then tries to read `.aws/config`. This causes `open_basedir` restriction related error for some setups. So this patch disables the CSM because it's most likely unused anyway. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Upload part size as S3 parameter instead of constant valueFlorent2020-06-152-3/+5
| | | | | | | | Some S3 providers need a custom upload part size (500 MB static value in Nextcloud). Here is a commit to change this value via S3 configuration, instead of using S3_UPLOAD_PART_SIZE constant. A new parameter is added for an S3 connection : uploadPartSize Signed-off-by: Florent <florent@coppint.com>
* Clear the statscache before fetching the metadataRoeland Jago Douma2020-05-281-0/+1
| | | | | | | | Else if a lot of writes happen. It might happen that an old stat result is used. Resulting in a wrong file size for the file. For example the text app when a lot of people edit at the same time. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #18955 from adrb/swift_upload_large_objectsRoeland Jago Douma2020-05-061-4/+14
|\ | | | | Large Object support for OpenStack Swift
| * Large Object support for OpenStack Swift.Adrian Brzezinski2020-04-271-4/+14
| | | | | | | | | | | | | | | | | | Until now, you wouldn't be able to create objects larger that 5GB. It's somewhat related with pull #18883 Signed-off-by: Adrian Brzezinski <adrian.brzezinski@eo.pl>
* | Fix getDirectoryContent implementation for Jail wrapperRobin Appelman2020-04-302-3/+3
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Run the cs fixer for green ciRoeland Jago Douma2020-04-301-6/+0
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Merge pull request #18883 from adrb/optimize_swift_14116Roeland Jago Douma2020-04-302-18/+48
|\ \ | | | | | | Optimize Openstack Swift files download
| * | It's a fix for issue #14116,Adrian Brzezinski2020-04-272-18/+48
| |/ | | | | | | | | | | | | | | | | | | Improves efficiency when downloading files from Swift storage. Before, files were downloaded and then pushed back to user. That behaevior causes all kinds of performance problems. Now, files are streamed directly to user. Signed-off-by: Adrian Brzezinski <adrian.brzezinski@eo.pl>
* / Update license headers for 19Christoph Wurst2020-04-2919-4/+25
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* filter out blacklisted files in getDirectoryContentRobin Appelman2020-04-231-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add method to storage backends to get directory content with metadataRobin Appelman2020-04-2011-59/+118
| | | | | | | | | | | | | | | | | Currently you need to use `opendir` and then call `getMetadata` for every file, which adds overhead because most storage backends already get the metadata when doing the `opendir`. While storagebackends can (and do) use caching to relief this problem, this adds cache invalidation dificulties and only a limited number of items are generally cached (to prevent memory usage exploding when scanning large storages) With this new methods storage backends can use the child metadata they got from listing the folder to return metadata without having to keep seperate caches. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #16946 from exussum12/patch-1Roeland Jago Douma2020-04-161-2/+2
|\ | | | | Increase max read
| * Update View.phpScott Dutton2020-04-151-2/+2
| |
| * Increase max readScott Dutton2020-04-121-2/+2
| | | | | | | | | | | | 8kb is very low, especially given this will be local files Signed-off-by: Scott Dutton <scott@exussum.co.uk>
* | Run cs:fix and fix HashWrapper codeMorris Jobke2020-04-151-1/+3
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Merge pull request #19540 from jlutran/fixKeystoneV3AuthMorris Jobke2020-04-151-0/+4
|\ \ | | | | | | Fix issues with Keystone auth v3 in files_external app
| * | Fix issues with Keystone auth v3 in files_external appJulien Lutran2020-04-151-0/+4
| | | | | | | | | | | | Signed-off-by: Julien Lutran <julien.lutran@corp.ovh.com>
* | | Merge pull request #20361 from nextcloud/write-stream-close-on-exceptionChristoph Wurst2020-04-151-3/+6
|\ \ \ | |/ / |/| | Close the streams in `writeStream` even when there is an exception
| * | Close the streams in `writeStream` even when there is an exceptionRobin Appelman2020-04-081-3/+6
| | | | | | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | | Return hashes of uploaded content for dav uploadsRobin Appelman2020-04-131-0/+72
| |/ |/| | | | | | | | | | | | | hashes are set in "X-Hash-MD5", "X-Hash-SHA1" and "X-Hash-SHA256" headers. these headers are set for file uploads and the MOVE request at the end of a multipart upload. Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Format code according to PSR2Christoph Wurst2020-04-103-0/+3
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Add visibility to all constantsChristoph Wurst2020-04-105-25/+25
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Add visibility to all methods and position of static keywordChristoph Wurst2020-04-106-58/+58
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>