Commit Graph
50 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
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
Tyler Gill b4f56750f8 Add IQuotaInfo interface
It also makes quota enabled backends return an instance of this interface instead of the quota components separately.
This way, getting quota stats requires only a single remote request on backends like Google Drive and OneDrive.
2017-09-24 17:30:52 -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 d893bd43cc Updated the GoogleDrive backend to use the nextPageToken field instead of the nextLink field, which has been removed from the v3 API. 2017-03-03 20:50:00 +01: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 7769822522 Updated the Google Drive backend to be more POSIX-like and pretend to only support a single file for a single name. 2016-01-06 21:53:37 +01:00
Kenneth Skovhede 6dac0f3c2e Fixed an invalid line-ending character 2015-08-05 13:51:56 +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