diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-18 23:55:43 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-11-28 00:01:46 -0500 |
commit | 89c98223ebf6bfeee5ef587ab748995e09dd4310 (patch) | |
tree | cda58811dd54ceeca59c22da7e3a9da24ddb01bd /src/SMAPI.Toolkit | |
parent | b349e956c6bb4608b4e158282700bf39e0072817 (diff) | |
download | SMAPI-89c98223ebf6bfeee5ef587ab748995e09dd4310.tar.gz SMAPI-89c98223ebf6bfeee5ef587ab748995e09dd4310.tar.bz2 SMAPI-89c98223ebf6bfeee5ef587ab748995e09dd4310.zip |
remove path-too-long exception handling
The path length limit no longer applies in .NET 5.
Diffstat (limited to 'src/SMAPI.Toolkit')
-rw-r--r-- | src/SMAPI.Toolkit/Utilities/PathUtilities.cs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/SMAPI.Toolkit/Utilities/PathUtilities.cs b/src/SMAPI.Toolkit/Utilities/PathUtilities.cs index 1d378042..2e9e5eac 100644 --- a/src/SMAPI.Toolkit/Utilities/PathUtilities.cs +++ b/src/SMAPI.Toolkit/Utilities/PathUtilities.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Diagnostics.Contracts; using System.IO; using System.Linq; @@ -150,32 +149,5 @@ namespace StardewModdingAPI.Toolkit.Utilities { return !Regex.IsMatch(str, "[^a-z0-9_.-]", RegexOptions.IgnoreCase); } - - /// <summary>Get the paths which exceed the OS length limit.</summary> - /// <param name="rootPath">The root path to search.</param> - internal static IEnumerable<string> GetTooLongPaths(string rootPath) - { - if (!Directory.Exists(rootPath)) - return new string[0]; - - return Directory - .EnumerateFileSystemEntries(rootPath, "*.*", SearchOption.AllDirectories) - .Where(PathUtilities.IsPathTooLong); - } - - /// <summary>Get whether a file or directory path exceeds the OS path length limit.</summary> - /// <param name="path">The path to test.</param> - internal static bool IsPathTooLong(string path) - { - try - { - _ = Path.GetFullPath(path); - return false; - } - catch (PathTooLongException) - { - return true; - } - } } } |