Ferdinand Thiessen
660f3f6fd1
refactor: use logical `&&` `||` instead of weak `and` `or` operators
...
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-09-27 23:02:18 +07:00
Ferdinand Thiessen
030c209d22
fix: Renaming does not need update but delete permissions
...
Renaming is basically copy + delete (a move), so no need to update permissions.
Especially if the node is in a invalid directory the node should be moveable but not editable.
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-08-28 17:22:20 +07:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
...
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
...
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Côme Chilliet
ec5133b739
fix: Apply new coding standard to all files
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +07:00
Joas Schilling
67958915da
fix(events): Make sure all `\OCP\Files::…` events are emitted with the same data
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-09 15:57:22 +07:00
Maxence Lange
e62e9e3dbf
IFilesMetadata
...
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2023-11-07 00:21:38 +07:00
Robin Appelman
5e347553bc
add method to create a node from cache entry + mountpoint
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-09-19 11:43:29 +07:00
Julius Härtl
7f958e81d3
fix: Pass parent to NonExistingFile instances
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-09-13 10:28:28 +07:00
Robin Appelman
5ac0e9b63b
reuse isValidPath from Filesystem
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-09-04 18:42:50 +07:00
Robin Appelman
baf8d2e1d0
make LazyFolder::get not load the real folder if we know the path
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-09-04 18:42:49 +07:00
Robin Appelman
9055fef5ef
add IFileInfo::getParentId
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-09-04 18:42:49 +07:00
Robin Appelman
e718cbc661
make Node::getParent lazy
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-09-04 18:42:48 +07:00
Joas Schilling
3962cd0aa8
fix!: Move getEventDispatcher usage to IEventDispatcher
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-28 14:11:22 +07:00
Arthur Schiwon
f6ac874dbf
chore: ugly type juggling
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 16:53:20 +07:00
Arthur Schiwon
167a5f394d
fix: add typehine for IRootFolder
...
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-06-21 16:53:19 +07:00
Julius Härtl
160bd75d0a
fix: Use proper path when creating node instances
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-04-17 23:46:52 +07:00
Robin Appelman
5bcf37b7ff
only fetch the data for mounts inside a folder when needed
...
for most operations we don't actually care about any mounts inside a folder, only for metadata that needs to propagate across storage boundaries (size, etag, mtime) do we need all the submount info.
By only loading this data when needed we can save a bunch of storage setup in a number of cases
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-09 11:39:00 +07:00
Côme Chilliet
cd885b5705
Type sizes as int|float throughout the code base
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:31 +07:00
Glandos
48ca33761f
Test valid path only if file info has to be retrieved
...
Signed-off-by: Glandos <bugs-github@antipoul.fr>
2022-11-06 19:23:53 +07:00
Julius Härtl
b2d6435737
Avoid extra query for the parent node if we can pass it along
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-08-24 22:20:32 +07:00
Robin Appelman
d84f9fa9bb
rename cached fileinfo on rename
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:28 +07:00
Robin Appelman
754603a04e
dont needlessly resolve path when getting internalPath/storage from Node
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:24 +07:00
Robin Appelman
700444e218
split out some path manipulation logic
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:12 +07:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
...
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
...
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard ) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases )
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md )
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +07:00
Christoph Wurst
d89a75be0b
Update all license headers for Nextcloud 21
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
...
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>
2020-04-10 14:19:56 +07:00
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +07:00
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +07:00
Christoph Wurst
5bf3d1bb38
Update license headers
...
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Julius Härtl
9eb1554fad
Properly anotate LockedException in files node api
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-11-28 14:17:15 +07:00
Robin Appelman
136c4ef925
dont expose metadata etag for now
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-13 12:39:36 +07:00
Robin Appelman
1b6e647b63
expose filecache extension data in FileInfo
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-13 12:39:32 +07:00
Arthur Schiwon
20901c59d4
emit file events via Dispatcher, too
...
another step to get rid of hooks and emitters
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-09 22:56:04 +07:00
Robin Appelman
3ca1e90044
allow renaming the root of a movable mount even if the parent folder is readonly
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-03-14 15:27:25 +07:00
Robin Appelman
8fc47c6f00
add option to get raw size (without submounts) from fileinfo
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-02-27 15:35:44 +07:00
Robin Appelman
e5c3e4b76f
Add getExtension() to FileInfo
...
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>
2018-10-29 15:24:02 +07:00
Roeland Jago Douma
235e3480e6
Actually return the root folder when traversing up the tree
...
If you now keep calling $node->getParent() you will at some point get
the RootFolder back. This is a nice termination check and will prevent
endless loops if an exit condition is slightly off.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-26 20:04:19 +07:00
Morris Jobke
4dbee99b7b
Remove useless return statements
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-25 22:50:40 +07:00
Vincent Petry
e667b28298
Fix files node API failed rename/copy
...
Whenever a rename or copy operation failed on the view, we must throw
an exception instead of just ignoring.
Signed-off-by: Vincent Petry <pvince81@owncloud.com>
2017-01-12 13:52:59 +07:00
Vincent Petry
eb5ea0e260
Refactor files node API for more code reuse
...
Signed-off-by: Vincent Petry <pvince81@owncloud.com>
2017-01-11 14:53:42 +07:00
Joas Schilling
0215b004da
Update with robin
2016-07-21 18:13:58 +07:00
Joas Schilling
ba87db3fcc
Fix others
2016-07-21 18:13:57 +07:00
Roeland Jago Douma
dedf392751
Move \OC\Files to PSR-4
2016-04-24 21:37:35 +07:00