Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions Source/Workspace/Celbridge.Resources/Helpers/ResourceUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,6 @@ namespace Celbridge.Resources.Helpers;

public class ResourceUtils
{
public static void CopyFolder(string sourceFolder, string destFolder)
{
DirectoryInfo dir = new DirectoryInfo(sourceFolder);

if (!dir.Exists)
{
throw new DirectoryNotFoundException($"Source directory does not exist or could not be found: {sourceFolder}");
}

DirectoryInfo[] dirs = dir.GetDirectories();
if (!Directory.Exists(destFolder))
{
Directory.CreateDirectory(destFolder);
}

FileInfo[] files = dir.GetFiles();
foreach (FileInfo file in files)
{
string tempPath = Path.Combine(destFolder, file.Name);
file.CopyTo(tempPath);
}

foreach (DirectoryInfo subdir in dirs)
{
string tempPath = Path.Combine(destFolder, subdir.Name);
CopyFolder(subdir.FullName, tempPath);
}
}

public static async Task<Result> OpenApplication(string path)
{
await Task.CompletedTask;
Expand Down
5 changes: 5 additions & 0 deletions Source/Workspace/Celbridge.Resources/Helpers/SidecarHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ private static string StripTrailingTerminator(string content)
/// </summary>
public static CelFileStatus Inspect(string absolutePath, ILogger logger)
{
// Direct read rather than via IFileStorage: Inspect runs synchronously
// inside ResourceClassifier during UpdateResourceRegistry, the absolute
// path has already been resolved through the root handler registry, and
// a transient read failure is benign (the file gets classified Broken
// and the next registry pass reclassifies it).
string text;
try
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Workspace/Celbridge.Resources/Services/FileStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ private static bool IsRootWritable(IRootHandlerRegistry rootHandlerRegistry, Res
|| handler.Capabilities.IsWritable;
}

// Recursive folder copy. Mirrors ResourceUtils.CopyFolder but stays internal
// to the FS layer so the chokepoint owns the destination structure.
// Recursive folder copy used by the chokepoint's CopyAsync path. Stays
// internal to the FS layer so the chokepoint owns the destination structure.
private static void CopyFolderRecursive(string sourceFolder, string destFolder)
{
Directory.CreateDirectory(destFolder);
Expand Down
Loading