Commit Graph

189 Commits

Author SHA1 Message Date
Vincent Petry d69243ee51 Fixed FTP and SMB to use rmdir() when deleting folders
Some storages need to use different calls for deleting files or folders,
usually unlink() and rmdir().

Fixes #4532 (SMB dir deletion)
Fixes #5941 (FTP dir deletion)

Note that the extra is_dir() should be fast because it's read from the
stat cache.
2013-11-29 13:01:01 +01:00
Vincent Petry 43b1cf7988 Redetect mime type whenever extension is renamed 2013-11-27 21:34:51 +01:00
Vincent Petry 2653d914d9 Merge pull request #6008 from owncloud/extstorage-smb-webdav-renamefix
Fixed SMB rename function to overwrite target file
2013-11-26 06:42:36 -08:00
Vincent Petry 712b47757a Updated unit tests for SMB
- coverage for touch return value
- fixed directory provider to exclude unsupported cases
2013-11-26 12:53:03 +01:00
Vincent Petry c3e34676ba Improved unit test for "overwrite on move"
Now using a different content to make sure the file was overwritten.
2013-11-25 18:54:58 +01:00
Vincent Petry af7118aa5d Added unit test for "overwrite file on rename/move"
Also fixed "rename" unit test that was ready the result out of the wrong
file.
2013-11-25 18:52:14 +01:00
Vincent Petry 5b6d1d79d0 Fixed SMB file deletion success detection
Since unlink() smb4php doesn't return true on deletion success, we need
to check whether the file was deleted to confirm success.

Fixes #5866
2013-11-19 15:05:11 +01:00
Morris Jobke 4a0d295e4a Merge pull request #5927 from owncloud/quota-excludeextstorage
External storage space is now not counted in total space
2013-11-18 14:42:40 -08:00
Vincent Petry 3e2fd9942b Root size for home storage is now size of "files" subdir
Fixes #4593
2013-11-18 18:17:25 +01:00
Vincent Petry 614e4d485c External storage space is now not counted in total space
Added argument to getFileInfo() to disable adding the size of
mountpoints to a directory's size.

Fixes #5924
2013-11-18 18:09:01 +01:00
Vincent Petry d9ab964ff9 Added missing test with leading backslash 2013-11-14 15:36:03 +01:00
Vincent Petry c06d8bb007 Fixed normalizePath() to strip out single dot dirs
Now removing "/./" and trailing "/." from the paths when normalizing.
2013-11-14 13:15:03 +01:00
Vincent Petry 34c92f6656 Now using HomeStorage for legacy home storage ids
Legacy home storage ids with the format "local://path/to/datadir/user1"
are now also wrapped by the HomeStorage.
2013-11-12 18:01:02 +01:00
Robin Appelman 32a703ab36 Do not use -1 as the size for the root folder of the home storage 2013-11-12 16:15:43 +01:00
Vincent Petry 7ff6a642b4 Fixed filesize issue in watchr test
Added clearstatcache to make sure we get the correct file size after
re-writing into the same file.

This failed on openSUSE 12.3 x86_64
2013-11-05 17:01:02 +01:00
Thomas Müller d25c8b43e6 Merge pull request #5652 from owncloud/front-port-5647-master
[WIP] extend unit test to directories starting or ending in whitespace
2013-11-01 23:11:33 -07:00
Jörn Friedrich Dreyer 10b2d649af extend unit test to directories starting or ending in whitespace 2013-10-31 14:24:43 +01:00
Thomas Müller 261cd87efa Merge branch 'master' into home-storage 2013-10-30 22:11:19 +01:00
Robin Appelman c9f3f2874f Merge branch 'master' into update-parent-storage-mtime
Conflicts:
	lib/private/files/cache/updater.php
2013-10-30 13:41:10 +01:00
Bjoern Schiessle fcfac51aa1 backport of https://github.com/owncloud/core/pull/5513 2013-10-29 15:08:12 +01:00
Robin Appelman 654b0daf01 update touch tests for updated behaviour 2013-10-29 14:22:13 +01:00
Robin Appelman b3626f34cd Update the parent folders storage_mtime on write and delete to prevent rescans 2013-10-29 14:18:57 +01:00
Robin Appelman f1e6e80eb1 add specialized storage backend for home folders 2013-10-29 00:14:23 +01:00
Vincent Petry c8df27de73 Fixed quota stream to not wrap read-only fopen calls 2013-10-25 12:33:16 +02:00
Vincent Petry d8b245490b Fixed quota stream's fseek method
- Added missing return statement
- Added missing support for SEEK_END
- Fixes #5524
2013-10-25 12:09:46 +02:00
VicDeo 26c0007a5f Merge pull request #5263 from owncloud/fixing-5255-master
Proper behavior of resolvePath()
2013-10-10 09:27:45 -07:00
Thomas Müller bc6e352ccd the path need to be normalized before putting it into resolvePath()
otherwise the returned internalPath will not match followup calls to e.g. Cache::getID()
2013-10-10 16:06:26 +02:00
Robin Appelman 1378af838c merge master into hooks-view-same-start 2013-10-10 11:34:30 +02:00
Robin Appelman 7f8eeb0474 ensure the view's root is a subfolder of the the default root, not only starting the same 2013-10-09 20:46:43 +02:00
Robin Appelman 38c563dcdc don't trigger the create hooks when if the file already exists for file_put_contents 2013-10-09 20:34:18 +02:00
Robin Appelman 235517f111 clear permissions cache when scanning a file 2013-09-24 00:57:58 +02:00
Andreas Fischer d9a36ee82e Move setUp() and tearDown() up in tests/lib/files/cache/scanner.php. 2013-09-23 12:45:02 +02:00
Andreas Fischer 4a9f1cc74d Merge remote-tracking branch 'owncloud/master' into fixing-4866-master
* owncloud/master: (98 commits)
  [tx-robot] updated from transifex
  files: when filtering search results, ensure results are children of the fakeroot not just path starting the same
  setting a default on filecache column unencrypted_size
  [tx-robot] updated from transifex
  remove unneccessary lib in namespace
  namespaces use upcasefirst parts when _ is left in namespace and files are named after their classes the autoloader will also find classes in the lib folder of an app its magic!
  initialize variable
  calculate correct permissions while toggle the password protection
  make sure that both $permissions and $oldPermissions have the same type
  Add copyright, remove starting blank line
  update inherit docs comment
  Fix insert/update/delete helper functions for oracle
  Add missing return true statements to legacy preferences functions
  Add missing static
  Convert OC_Preference to object interface
  fix race condition in lazy preview loading
  use {count} instead of 'One' for more versatile translation
  fix double translation of error message
  use n to translate title
  fixing typos and l10n
  ...

Conflicts:
	tests/lib/files/cache/scanner.php
2013-09-23 12:44:11 +02:00
Thomas Müller 03eedb58fc Merge pull request #4327 from owncloud/scanfile-remove
remove deleted files while scanning
2013-09-22 22:40:13 -07:00
Robin Appelman a1d4eb1f95 files: when filtering search results, ensure results are children of the fakeroot not just path starting the same 2013-09-22 01:24:12 +02:00
Andreas Fischer de2e6e137b Do not convert boolean to integer in tests. put() already does this. 2013-09-21 00:12:13 +02:00
Thomas Müller d84d548618 when storing back the data field 'encrypted' it is necessary to cast the boolean to an integer to make pg happy 2013-09-20 20:34:17 +02:00
Thomas Müller c8f9efeb94 etag changes are now propagated up the file tree 2013-09-16 23:32:17 +02:00
Thomas Müller 3c026b7cf6 recreate an etag within the scanner if the cache contains an empty etag 2013-09-16 12:09:15 +02:00
Thomas Müller 6eeb4d165c - giving the user a new id for each test run in order to prevent reuse of e.g. permissions data in the database
- setting the current user id because \OC\FilesView relies on \OC_User::getUser()
2013-09-13 21:44:31 +02:00
Robin Appelman c9d2663159 Merge branch 'master' into fileapi-foreward 2013-09-12 21:43:35 +02:00
Robin Appelman b9167196fb adjust test cases to namespace changes 2013-09-10 22:21:49 +02:00
Bernhard Posselt fbedd643f7 Merge pull request #4477 from owncloud/hooks-view
also emit hooks for views that are a subfolder of the user folder
2013-09-04 16:09:22 -07:00
Robin Appelman a22f9ff301 Provide an implementation of the fileapi for oc6 build on top of the old api 2013-09-01 19:47:48 +02:00
Robin Appelman bf9045f585 test case for hooks send from a non-default view 2013-08-29 15:25:38 +02:00
Robin Appelman d8c71ba734 merge master in storage-wrapper-quota 2013-08-18 11:34:56 +02:00
Robin Appelman 1877a42a0d Scanner: additional tests for reusing etags during scanning 2013-08-12 15:37:15 +02:00
Robin Appelman 3e7a86c6ec remove deleted files while scanning 2013-08-06 15:59:06 +02:00
Michael Gapczynski afff750011 Add test for calculating size of newly empty folder 2013-07-29 10:23:14 -04:00
Robin Appelman cd8f0c21ce add quota storage wrapper 2013-07-25 00:31:51 +02:00