Commit Graph
41 Commits
Author SHA1 Message Date
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
Kenneth Hsu afab61a05b Use pattern matching to simplify casts. 2019-10-19 10:15:38 -07:00
Kenneth Hsu b542cc627b Fix Google Cloud storage class help text.
This addresses issue #3857.
2019-08-15 09:51:05 -07: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 d53f1a53d2 Remove unused property.
According to the Google Cloud v1 documentation, the prefixes property is
not returned by the Buckets:list method.
2019-05-30 20:40:02 -07:00
Kenneth Hsu a4e990a859 Disable warning about unused class. 2019-05-27 21:10:21 -07: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
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 07c1d85b4a Remove empty statements. 2018-10-10 21:22:31 -07:00
Kenneth Hsu d4d1945faf Use utility method to append trailing slash.
This removes some duplicated code.
2018-09-22 10:19:45 -07:00
Kenneth Skovhede e9850224e2 Made the gcs backend available again. 2018-06-18 15:05:02 +02: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 3691d6dfdf Initiated basic unit tests to ensure correct url helper functions. 2018-05-29 22:13:09 +02:00
verhoek 1ba8814d76 Started moving url specific construction to webapi. 2018-05-28 08:29:23 +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 cac891d187 Added BucketObjectPath helper method. 2018-05-20 11:10:37 +02:00
verhoek 13ef221196 Updated Rename method. 2018-05-20 10:57:49 +02:00
verhoek 745b77da23 Renamed WebApi GoogleCloudServices to GoogleCloudStorage. Refactored Get. Fixed Layout. 2018-05-20 10:50:37 +02:00
verhoek 18de687530 Updated Put and Createfolder using WebApi. 2018-05-19 23:06:02 +02: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 6dd64a553d Fixed code quality issues. 2018-05-14 21:01:18 +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 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 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
Tyler Gill 83a1dcfb64 Replace all instances of InvariantCultureIgnoreCase with OrdinalIgnoreCase in string comparisons.
InvariantCulture is useful when comparing / sorting human language strings in a culturely correct way. It handles things like accented letters in a way that makes sense to humans (e.g., 'a' should be sorted next to 'á', rather than after 'z').
Ordinal looks just at the raw code points of the characters. As such, it is recommended for use in cases when comparing system strings (file paths, command line parameters, config settings, etc.). Since it doesn't need to use the culture specific sorting rules, this method can often be faster.

For more information, see https://stackoverflow.com/questions/492799/difference-between-invariantculture-and-ordinal-string-comparison (and other related questions)
2017-09-18 23:55:08 -06:00
Kenneth Skovhede a029890409 Implemented better default error messsages 2017-01-09 11:35:38 +01:00
Kenneth Skovhede 0c68daff6c Fixed all whitespace to be 4 spaces instead of tabs 2016-09-15 11:39:27 +02:00
Kenneth Skovhede d0711011a2 Rewrote all WebRequest code to use AsyncHttpRequest, and normalized usage such that WebResponse objects are always correctly disposed. 2016-04-16 11:12:28 +02:00
Kenneth Skovhede 6dac0f3c2e Fixed an invalid line-ending character 2015-08-05 13:51:56 +02:00
Kenneth Skovhede 97ea6350c4 Improved refactor-abiility 2015-07-10 01:21:57 +02:00
Kenneth Skovhede fed160fa1c Implemented chunked-resumeable uploads for Google Drive for issue #1347.
Implemented a Google Cloud Storage backend, which closes #784.
This also adds support for Nearline and DRA so it closes #1385.
2015-06-29 22:37:31 +02:00