Commit Graph
59 Commits
Author SHA1 Message Date
Kenneth Skovhede 7031bc57b6 Adding ConfigureAwait(false) to all async enumerations 2025-02-18 09:18:36 +01:00
Kenneth Skovhede 0f9669b273 Final conversion to async backends
This PR is the final change, where all backends are now purely implemented with async interfaces.

The code changes here replace the LIST call with an async version. This affect all backends (and then some) but the changes are mostly mechanical rewrites of the code.

In many places, the backeds were already prepared for async output, in other some glue was needed.

To reduce the scope of this change, some backends simply report a synchronous result as an async list.
2025-02-17 16:45:51 +01:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Kenneth SkovhedeandGitHub 8f853cfa7f Google drive and GCS do not work with timeout (#5812) 2024-12-26 10:42:58 +01:00
Kenneth Skovhede 61ea36091a Added DNSNames as async 2024-10-02 09:37:52 +02:00
Kenneth Skovhede 586c08522e Implemented async method for Test, CreateFolder and Quota in all backends.
Still missing the List and DNSHostnames.
The AsyncRequest class is also preventing many backends from fully upgrading.
2024-10-01 09:30:02 +02:00
Kenneth Skovhede 8bdb85e261 Implemented RenameAsync on all backends supporting rename 2024-09-29 23:21:50 +02:00
Kenneth Skovhede ecf2e8b551 Implemented DeleteAsync on all backends 2024-09-29 23:04:54 +02:00
Kenneth Skovhede e3e3d1305f Implemented async version of Get for all backends. 2024-09-29 22:00:57 +02:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Kenneth Hsu de2a651763 Fix bug in PutAsync implementations.
Without await, the using statement can dispose the Stream before the
call to PutAsync completes, resulting in an ObjectDisposedException.

This fixes #4556.
2021-06-12 15:12:13 -07:00
warwickmmandGitHub 771c10c1dd Merge pull request #3858 from BlueBlock/fix-googledrive-rename
Fix Backend Google Drive Rename() method
2019-08-15 09:58:02 -07:00
BlueBlock 79aa0164f9 fix rename method
use the other methods to rename a file
2019-08-14 18:26:47 -04:00
BlueBlock 1fbdb466fa filter out googledrive trashed items 2019-08-12 13:44:19 -04:00
Kenneth Hsu be65f58059 Remove unused properties.
Although these are returned in the JSON from Google Cloud and Google
Drive, they are unused.  Json.NET by default will ignore JSON properties
that do not have corresponding class properties.
2019-06-01 19:01:16 -07:00
Kenneth Hsu 4332436102 Disable warning about unused class. 2019-05-27 21:09:54 -07:00
mukut1994 6f34002aea Add google team drive support 2019-04-04 23:30:59 +01:00
Sean Templeton b02b19e683 Change Put method name to PutAsync 2019-03-17 18:28:45 -05:00
Sean Templeton 7843f837a4 Update Google Cloud and Drive backends for async Put 2019-03-05 21:08:25 -06:00
Sean Templeton 0c122ff550 Change IBackend and IStreamingBackend to return Task for Put() 2019-03-03 21:43:10 -06:00
Kenneth Hsu 953daae9bb Fix quota reporting with GoogleDrive backend.
The second argument to QuotaInfo is the amount of free space.
Previously, we were providing the amount of bytes used.
2019-01-12 19:27:15 -08:00
verhoek b2cc18426c Renamed Library.IO to Library.Common.IO.
Moved basic Platform functions to Library.Common.Platform.
Turned IO_OS into property within Library.Common.
2018-11-02 21:34:07 +01:00
verhoek bc053df294 Moved basic IO helper functions to Library.IO. 2018-10-27 12:17:07 +02:00
Kenneth Hsu d4d1945faf Use utility method to append trailing slash.
This removes some duplicated code.
2018-09-22 10:19:45 -07:00
verhoek bc826b2300 Tidy up. 2018-06-09 11:07:13 +02:00
verhoek 7b5779ca5d Merge remote-tracking branch 'origin' into webapi/googlecloudstorage
# Conflicts:
#	Duplicati/Library/Backend/GoogleServices/GCSConfig.cs (line endings)
#	Duplicati/Library/Backend/GoogleServices/GoogleCloudStorage.cs (readonly)
2018-06-09 08:49:23 +02:00
verhoek 40b83fe2dc Moved out AboutInfoUrl and CreateFolderUrl. 2018-06-03 19:46:54 +02:00
verhoek c063fde018 Moved ListUrl, PutUrl and DeleteUrl to WebApi. 2018-06-01 16:21:28 +02:00
verhoek 83679c0f12 Moved Rename and Get Url to Google WebAPI. 2018-05-30 08:22:00 +02:00
Kenneth Hsu f12858e6a5 Mark fields that shouldn't be reassigned as readonly.
This makes it explicit at compile-time that these fields should not be
reassigned outside the constructor.
2018-05-25 10:04:52 -07:00
verhoek d6a85ae497 Imports organized, bucket locations moved to google webapi. 2018-05-18 23:00:01 +02:00
verhoek 41234a314d Introduced UrlPath wrapper for stringbuilder to ease concatenation of multiple paths.
Started cleaning googlecloud services API.
2018-05-18 22:55:09 +02:00
verhoek 1cde60c640 Removed misplaced leftover line. 2018-05-15 20:28:52 +02:00
verhoek 6dd64a553d Fixed code quality issues. 2018-05-14 21:01:18 +02:00
verhoek dae12fee53 Organized imports. 2018-05-13 16:27:14 +02:00
verhoek a67248f51f Moved Api strings to separate class similarly to the constant setup in Strings.cs. 2018-05-13 16:22:41 +02:00
verhoek 051b030836 Fixed typo regarding pageToken. Integrated other strings in static string class. 2018-05-12 12:42:51 +02:00
verhoek 44b5b00276 Renamed some googledriveapi var names. Modified ListFolder to be more readable. 2018-05-11 19:57:09 +02:00
verhoek 78a46c3a5c Renamed misspelled class urluttility to urlutility and newly added urlutility to uriutility. 2018-05-11 19:09:14 +02:00
verhoek d303db30d6 Replacing magic strings in google drive rest calls by query key value pairs. 2018-05-11 18:23:16 +02:00
verhoek ddba3459bf Removed extra local var. 2018-04-30 20:50:49 +02:00
Kenneth Skovhede 842fd96543 Implemented a new logging system that is more transparent and allows a more granular way of picking log messages.
Added ID's to each log message and each exception to allow later introduction of a Knowledgebase service that explains each error in more detail.
2018-03-15 09:12:34 +01:00
Kenneth Skovhede bd863016fa Added support for returning multiple DNS names for cache invalidation.
Updated most backends to return the actual DNS names for cache invalidation.
2018-02-26 11:37:10 +01:00
Rune Henriksen fc77b476fc changed from NYI to null returns. Added check to skip DNS check if no DNSName is provided 2018-02-21 22:38:01 +01:00
Rune Henriksen 00292953c3 added DNSName getter on Backend interface and added NotImplementedException methods on each backend class 2018-02-18 00:18:44 +01:00
Kenneth Skovhede 03b51b77af Updated the Google Drive backend to support TeamDrives. 2018-01-20 11:04:54 +01:00
Kenneth Hsu 8810e0130d Make string comparisons use ordinal (binary) sort rules.
These string comparisons should not be culture-aware.
2017-11-26 11:19:54 -08:00
Tyler Gill 44c53d3eb1 Merge branch 'master' of https://github.com/duplicati/duplicati into fix/list-ienumerable 2017-09-25 23:19:38 -06:00
Tyler Gill b3a3911d98 Change from wrapping yield returning methods with methods that do a try/catch, since they don't work due to lazy evaluation. 2017-09-25 23:19:31 -06:00
Tyler Gill 38883285ee Change IBackend.List() to return IEnumerable instead of List
By changing to IEnumerable, it is possible to iterate only a portion of the list, which is useful when not all entries are needed (e.g., when testing a connection).
All existing backends have been updated, and any which were able to be changed to yield return results in a straightforward way now do.
Many backends had a try/catch in the List() method. Due to the fact that yield returns can't be placed within a try/catch block, these have been refactored to either scope the try/catch to the parts that (should) be the only places throwing exceptions, so that exceptions are still caught and handled.
Note that lazy evaluation may cause some changes in behavior - exceptions that were previously thrown at the point of invokation of List() may now be thrown while it is being enumerated.
I believe this will not be problematic though, as the only well-known exception seems to be FolderMissingException, which should be thrown by Test(), but TestList() attempts to enumerate the list to force this exception.
Any places that require the legacy behavior can get it by simply converting the lazy enumerable to a List()
2017-09-25 23:17:45 -06:00