Commit Graph
133 Commits
Author SHA1 Message Date
Kenneth SkovhedeandGitHub 7330aebaeb Merge pull request #3394 from warwickmm/remove_unnecessary_indirection
Use built-in method to expand environment variables
2018-09-28 22:25:46 +02:00
Kenneth Hsu d4692e2d35 Use built-in method to expand environment variables.
After we removed the tilde expansion in revision c9aa6cf5fb ("Avoid
performing tilde expansion"), the Utility.ExpandEnvironmentVariables
method simply called System.Environment.ExpandEnvironmentVariables.  We
can simplify the code by just referencing the built-in method directly.
2018-09-22 19:59:46 -07:00
Kenneth Hsu a325a8e0e7 Fix XML documentation to more accurately reflect behavior. 2018-09-22 10:19:45 -07:00
Kenneth Hsu 67871a76ed Fix bug. Append separator when string ends with same separator.
Previously, the replacement would occur if the provided string did not
end with the platform-dependent directory separator.  However, this
utility method is often used to append a trailing slash to URL
specifiers.
2018-09-22 10:19:45 -07:00
Kenneth Hsu b45c41026e Use ordinal file path comparisons.
This addresses issue #3342.
2018-08-30 21:52:02 -07:00
Kenneth SkovhedeandGitHub 05059e3859 Merge pull request #3329 from warwickmm/refactor/remove_unused_utilities
Remove unused members from Utility class
2018-08-29 11:27:33 +02:00
Kenneth Skovhede 2ec203cabe Removed Task types and the TaskReader property from serialized results, as they have no usable serialized format 2018-08-08 11:59:20 +02:00
Kenneth Hsu 6b521691ce Remove unused ENVIRONMENT_VARIABLE_MATCHER_LINUX property.
This was added in revision 0b442ecdc6, but no usages could be found.  A
potential use-case is mentioned in a comment, so the implementation was
moved to the comment.
2018-08-02 21:40:51 -07:00
Kenneth Hsu 79f143e84a Remove unused ToUnixTimestamp utility method.
This was added in revision 6255572c25 ("Added a timestamp value to the
end of dates in the report output for easier parsing"), but no usages
could be found.
2018-08-02 21:36:32 -07:00
Kenneth Hsu f2b682e94f Remove unused Base64UrlDecode utility method.
This was added in revision aca4ed95cc ("More work on the block hash"),
but no usages could be found.
2018-08-02 21:36:32 -07:00
Kenneth Hsu a1a4bd8b90 Remove unused ReplaceFile utility method.
This was added in revision a0521da54d ("Initial version of the new
block-based storage format"), but no usages could be found.
2018-08-02 21:36:29 -07:00
Kenneth Hsu da3cf6d2b3 Remove unused DefaultCulture utility property.
Usages were removed in revision 2264c07f3b ("Removed unused files").
2018-08-02 21:36:25 -07:00
Kenneth Hsu 70b0d093fe Remove unused CalculateHash utility method.
Usages were removed in revision 3ff2f1eb98.
2018-08-02 21:36:20 -07:00
Kenneth Hsu c3cda5dc58 Remove unused IsValidHostname utility method.
Usages were removed in revision 62c75d9af9 ("Removed all informs code
(no more 1.3.x UI)").
2018-08-02 21:29:09 -07:00
Kenneth Hsu c7f4bcd0d3 Remove unused LocateFileInSystemPath utility method.
Usages were removed in revision 62c75d9af9 ("Removed all informs code
(no more 1.3.x UI)").
2018-08-02 21:27:25 -07:00
Kenneth Hsu 54c4f9224d Allow tasks to complete on any thread when context is irrelevant.
When the code following the await can be executed on any thread, it's
recommended to use ConfigureAwait(false) to avoid unnecessary context
switching and potential deadlocks.
2018-06-21 19:28:27 -07:00
Kenneth SkovhedeandGitHub db1bf986be Merge pull request #3267 from verhoek/fix/subprocess_readkey
Fix - Console.ReadKey for encryption passphrase
2018-06-15 09:10:54 +02:00
verhoek 07ae90f325 Simplified plus made defaults explicit. 2018-06-12 09:41:40 +02:00
Kenneth Skovhede d01e8f19c4 Fixed an issue after the merge conflict ... 2018-06-08 11:21:43 +02:00
Kenneth Skovhede 9485339659 Fixed an issue after the merge conflict 2018-06-08 11:20:03 +02:00
Kenneth Skovhede bce1db123a Merge branch 'master' into feature/speedup_backup_index_files
# Conflicts:
#	Duplicati/Library/Utility/Utility.cs
2018-06-08 10:31:27 +02:00
Kenneth Hsu 1605dc8ede Use utility method to read from stream. 2018-06-06 19:54:45 -07:00
verhoek 2f41e02ca9 Merge branch 'master' into refactored 2018-05-18 08:05:19 +02:00
verhoek 30cd41585b Corrected spelling function name. 2018-05-16 20:08:40 +02:00
verhoek 007e4c0829 Cleaned up imports. 2018-05-13 12:48:00 +02:00
Kenneth Skovhede 05d0a2d38e Added a counter to get the number of copied bytes when calling CopyStream() 2018-05-09 17:21:15 +02:00
Daniel Gehriger 33d64ee442 Reduced number of affected files by PR 2018-04-26 23:12:39 +02:00
Daniel Gehriger 1af7f9e0ca Merge remote-tracking branch 'upstream/master' into feature/usn 2018-04-23 22:28:27 +02:00
Daniel Gehriger a7d60d88d7 Fixed post-processing of modified file list obtain from USN 2018-04-22 23:03:15 +02:00
Daniel Gehriger 8c1322273e Updated comment to retrigger AppVeyor 2018-04-20 23:51:26 +02:00
Daniel Gehriger b97d4e0dbb Correctly filtering list of changed files / folders using exclusion filter 2018-04-20 17:30:08 +02:00
Daniel Gehriger 8af63b1d5d Fixed some of the issues reported by codacy. The others are incorrect warnings. 2018-04-20 09:17:06 +02:00
Daniel Gehriger 2c1a0ddb4e Implemented backup based on changes recorded in NTFS USN journal 2018-04-19 22:59:28 +02:00
Kenneth Skovhede cdd3c7b63c Merge branch 'master' into concurrent_processing 2018-04-12 15:10:03 +02:00
Kenneth Skovhede 4e5f4a12bf Merge branch 'master' into feature/filters-for-sendmail
Integrated changes to support log-lines and to have a common shared module for reporters

# Conflicts:
#	Duplicati/Library/Modules/Builtin/Duplicati.Library.Modules.Builtin.csproj
#	Duplicati/Library/Modules/Builtin/RunScript.cs
#	Duplicati/Library/Modules/Builtin/SendHttpMessage.cs
#	Duplicati/Library/Modules/Builtin/SendJabberMessage.cs
#	Duplicati/Library/Modules/Builtin/SendMail.cs
2018-04-12 11:16:57 +02:00
Kenneth Skovhede 79f7b22e0f Merge branch 'master' into concurrent_processing
Changed a few things on the way, removing the log process

# Conflicts:
#	Duplicati/Library/Main/Controller.cs
#	Duplicati/Library/Main/Database/ExtensionMethods.cs
#	Duplicati/Library/Main/Database/LocalBackupDatabase.cs
#	Duplicati/Library/Main/Duplicati.Library.Main.csproj
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	Duplicati/Library/Main/Operation/FilelistProcessor.cs
#	Duplicati/Library/Main/Operation/PurgeBrokenFilesHandler.cs
#	Duplicati/Library/Main/Operation/TestFilterHandler.cs
#	Duplicati/Library/Main/Options.cs
#	Duplicati/Library/Main/ResultClasses.cs
#	Duplicati/UnitTest/BasicSetupHelper.cs
2018-04-11 23:02:47 +02:00
Fish 03fe3729cf Cache IsFSCaseSensitive to speed up file counting.
"IsFSCaseSensitive" used to call GetEnvironmentVariable() every time it
was accessed, which unnecessarily slows down the file counting procedure.
Caching the value of this environment variable speeds up things quite a
bit.
2018-04-10 20:46:03 -07:00
Kenneth Skovhede 731ecfc47d Rewrote the report modules to use a shared base class with all the non-sending specific code.
Change the logic for how the log data is included. It is now added as log lines _after_ the normal messages.
Added support for limiting the number of log lines sent.
Added support for setting the log levels on the modules.
Added support for setting a log filter on the modules.
Added support for sending log data as JSON from the http module.
2018-04-10 12:58:06 +02:00
Kenneth Skovhede bceed2ffbe Work on adding filters to send-mail 2018-04-02 11:20:46 +02:00
Tyler Gill 73b6fe2a01 Add extension methods to the general Utility class for emulating the await keyword in non-async code.
Using GetAwaiter().GetResult() is similar to using Task.Result, but rethrows the original exception rather than wrapping it in an (unnecessary) AggregateException.
2018-03-20 13:41:57 -06:00
Daniel Radünz dab0e1102b Fixed issue 2994 2018-01-30 23:49:58 +01:00
Kenneth Skovhede 75bf6857c1 Merge branch 'master' into concurrent_processing
# Conflicts:
#	.travis.yml
#	Duplicati/Library/Main/Database/LocalBackupDatabase.cs
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	Duplicati/Library/Main/ResultClasses.cs
#	Duplicati/Library/Main/Volumes/VolumeWriterBase.cs
#	Duplicati/Library/Utility/TempFile.cs
2018-01-20 15:02:41 +01:00
JonMikelV 95a768feaa FormatSizeString now will also format negative values such as produced when reporting on space savings due to compacting. 2018-01-04 23:05:01 -06:00
Kenneth Hsu 056ff3da96 Use built-in method to determine if process is 64-bit. 2018-01-02 19:03:46 -08:00
Kenneth Skovhede 954980b013 Merge branch 'feature/fix_windows_cmd_escape' 2017-12-22 10:05:53 +01:00
Kenneth Skovhede 486ea11fbd Fixed a case where the commandline arguments were not correctly escaped.
This fixes #2907
2017-12-20 22:45:44 +01:00
Kenneth Hsu bbebcdf3c9 Use method to parse string into bool to reduce duplication. 2017-12-17 14:52:29 -08:00
Kenneth Hsu 788a1db877 Add overload for method that parses string into bool.
This is useful for cases where the default value is expensive to
compute.  By specifying the default via a delegate, it is not computed
unless it is needed.
2017-12-17 14:52:29 -08:00
Kenneth Hsu ab489d9a28 Make parameter names in XML documentation match code. 2017-12-09 18:42:30 -08:00
Kenneth Hsu 1c7391399d Remove XML documentation for unmatched parameters. 2017-12-09 18:30:01 -08:00