diff --git a/README.md b/README.md
index fa70731f..7b74e4bd 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,15 @@ Any modifications or adaptations made to the original graphics and styles are my
To explore more about Enlightenment and their contributions to the open-source community, please visit the [official Enlightenment website](https://www.enlightenment.org/).
+### Icons
+
+Most icons were taken from [Lyra Icon Theme](https://github.com/yeyushengfan258/Lyra-icon-theme/tree/master/src), a beautiful icon theme for Linux desktops.
+
+Several icons used in this project were adapted from icons sourced from [svgrepo](https://www.svgrepo.com/).
+
+- [`toggle-thumbnails.svg`](https://www.svgrepo.com/svg/370469/page-image) (Public Domain license)
+- [`toggle-hidden.svg`](https://www.svgrepo.com/svg/470389/hidden) (MIT License)
+
## License
This project is licensed under the GPLv3.0. See the [LICENSE](./docs/LICENSE.md) file for details.
\ No newline at end of file
diff --git a/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQuery.cs b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQuery.cs
new file mode 100644
index 00000000..2ab3470e
--- /dev/null
+++ b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQuery.cs
@@ -0,0 +1,14 @@
+#region ========================================================================= USING =====================================================================================
+using ErrorOr;
+using Lumina.Contracts.Responses.FileManagement;
+using Mediator;
+using System.Collections.Generic;
+#endregion
+
+namespace Lumina.Application.Core.FileManagement.Paths.Queries;
+
+///
+/// Query for retrieving the parent of a file system path.
+///
+/// The path for which to get the parent.
+public record GetPathParentQuery(string Path) : IRequest>>;
\ No newline at end of file
diff --git a/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQueryHandler.cs b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQueryHandler.cs
new file mode 100644
index 00000000..92fa47b3
--- /dev/null
+++ b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQueryHandler.cs
@@ -0,0 +1,50 @@
+#region ========================================================================= USING =====================================================================================
+using ErrorOr;
+using Lumina.Contracts.Responses.FileManagement;
+using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
+using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.ValueObjects;
+using Mapster;
+using Mediator;
+using System.Collections.Generic;
+using System.Threading;
+using System.Threading.Tasks;
+#endregion
+
+namespace Lumina.Application.Core.FileManagement.Paths.Queries;
+
+///
+/// Handler for the query to get the parent of a file system path.
+///
+public class GetPathParentQueryHandler : IRequestHandler>>
+{
+ #region ================================================================== FIELD MEMBERS ================================================================================
+ private readonly IPathService _pathService;
+ #endregion
+
+ #region ====================================================================== CTOR =====================================================================================
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected service for managing file system paths.
+ public GetPathParentQueryHandler(IPathService pathService)
+ {
+ _pathService = pathService;
+ }
+ #endregion
+
+ #region ===================================================================== METHODS ===================================================================================
+ ///
+ /// Gets the parent of the specified file system path.
+ ///
+ /// The query containing the requested path.
+ /// Cancellation token that can be used to stop the execution.
+ ///
+ /// An containing either a collection of , or an error message.
+ ///
+ public ValueTask>> Handle(GetPathParentQuery request, CancellationToken cancellationToken)
+ {
+ ErrorOr> result = _pathService.GoUpOneLevel(request.Path);
+ return ValueTask.FromResult(result.Match(values => ErrorOrFactory.From(result.Value.Adapt>()), errors => errors));
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQueryValidator.cs b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQueryValidator.cs
new file mode 100644
index 00000000..7063cf8d
--- /dev/null
+++ b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathParentQueryValidator.cs
@@ -0,0 +1,22 @@
+#region ========================================================================= USING =====================================================================================
+using FluentValidation;
+using Lumina.Domain.Common.Errors;
+#endregion
+
+namespace Lumina.Application.Core.FileManagement.Paths.Queries;
+
+///
+/// Validates the needed validation rules for .
+///
+public class GetPathParentQueryValidator : AbstractValidator
+{
+ #region ====================================================================== CTOR =====================================================================================
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public GetPathParentQueryValidator()
+ {
+ RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathRootQueryValidator.cs b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathRootQueryValidator.cs
new file mode 100644
index 00000000..5445e2b8
--- /dev/null
+++ b/src/Lumina.Application/Core/FileManagement/Paths/Queries/GetPathRootQueryValidator.cs
@@ -0,0 +1,22 @@
+#region ========================================================================= USING =====================================================================================
+using FluentValidation;
+using Lumina.Domain.Common.Errors;
+#endregion
+
+namespace Lumina.Application.Core.FileManagement.Paths.Queries;
+
+///
+/// Validates the needed validation rules for .
+///
+public class GetPathRootQueryValidator : AbstractValidator
+{
+ #region ====================================================================== CTOR =====================================================================================
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public GetPathRootQueryValidator()
+ {
+ RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQuery.cs b/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQuery.cs
new file mode 100644
index 00000000..7c786b8a
--- /dev/null
+++ b/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQuery.cs
@@ -0,0 +1,12 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Contracts.Responses.FileManagement;
+using Mediator;
+#endregion
+
+namespace Lumina.Application.Core.FileManagement.Paths.Queries;
+
+///
+/// Query for validating a path.
+///
+/// The path to be validated.
+public record ValidatePathQuery(string Path) : IRequest;
\ No newline at end of file
diff --git a/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQueryHandler.cs b/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQueryHandler.cs
new file mode 100644
index 00000000..767d5d2b
--- /dev/null
+++ b/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQueryHandler.cs
@@ -0,0 +1,45 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Contracts.Responses.FileManagement;
+using Lumina.Domain.Core.Aggregates.FileManagement.FileManagementAggregate.Services;
+using Mediator;
+using System.Threading;
+using System.Threading.Tasks;
+#endregion
+
+namespace Lumina.Application.Core.FileManagement.Paths.Queries;
+
+///
+/// Handler for the query to validate a file system path.
+///
+public class ValidatePathQueryHandler : IRequestHandler
+{
+ #region ================================================================== FIELD MEMBERS ================================================================================
+ private readonly IPathService _pathService;
+ #endregion
+
+ #region ====================================================================== CTOR =====================================================================================
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Injected service for managing file system paths.
+ public ValidatePathQueryHandler(IPathService pathService)
+ {
+ _pathService = pathService;
+ }
+ #endregion
+
+ #region ===================================================================== METHODS ===================================================================================
+ ///
+ /// Validates the specified file system path.
+ ///
+ /// The query containing the request.
+ /// Cancellation token that can be used to stop the execution.
+ ///
+ /// if the specified path is valid, otherwise.
+ ///
+ public ValueTask Handle(ValidatePathQuery request, CancellationToken cancellationToken)
+ {
+ return ValueTask.FromResult(new PathValidResponse(_pathService.IsValidPath(request.Path)));
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQueryValidator.cs b/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQueryValidator.cs
new file mode 100644
index 00000000..ee86b0d4
--- /dev/null
+++ b/src/Lumina.Application/Core/FileManagement/Paths/Queries/ValidatePathQueryValidator.cs
@@ -0,0 +1,22 @@
+#region ========================================================================= USING =====================================================================================
+using FluentValidation;
+using Lumina.Domain.Common.Errors;
+#endregion
+
+namespace Lumina.Application.Core.FileManagement.Paths.Queries;
+
+///
+/// Validates the needed validation rules for .
+///
+public class ValidatePathQueryValidator : AbstractValidator
+{
+ #region ====================================================================== CTOR =====================================================================================
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ValidatePathQueryValidator()
+ {
+ RuleFor(x => x.Path).NotEmpty().WithMessage(Errors.FileManagement.PathCannotBeEmpty.Code);
+ }
+ #endregion
+}
\ No newline at end of file
diff --git a/src/Lumina.Contracts/Responses/FileManagement/FileSystemTypeResponse.cs b/src/Lumina.Contracts/Responses/FileManagement/FileSystemTypeResponse.cs
index 0e0ca42e..73477def 100644
--- a/src/Lumina.Contracts/Responses/FileManagement/FileSystemTypeResponse.cs
+++ b/src/Lumina.Contracts/Responses/FileManagement/FileSystemTypeResponse.cs
@@ -1,5 +1,6 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.Enums.FileSystem;
+using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.FileManagement;
@@ -8,6 +9,7 @@ namespace Lumina.Contracts.Responses.FileManagement;
/// Represents a response containing the file system platform type.
///
/// The returned file system platform type.
+[DebuggerDisplay("{PlatformType}")]
public record FileSystemTypeResponse(
PlatformType PlatformType
);
\ No newline at end of file
diff --git a/src/Lumina.Contracts/Responses/FileManagement/PathSegmentResponse.cs b/src/Lumina.Contracts/Responses/FileManagement/PathSegmentResponse.cs
index 58e5827d..1cf90572 100644
--- a/src/Lumina.Contracts/Responses/FileManagement/PathSegmentResponse.cs
+++ b/src/Lumina.Contracts/Responses/FileManagement/PathSegmentResponse.cs
@@ -1,9 +1,14 @@
-namespace Lumina.Contracts.Responses.FileManagement;
+#region ========================================================================= USING =====================================================================================
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Responses.FileManagement;
///
/// Represents a response containing a file system path.
///
/// The returned path.
+[DebuggerDisplay("{Path}")]
public record PathSegmentResponse(
string Path
);
\ No newline at end of file
diff --git a/src/Lumina.Contracts/Responses/FileManagement/PathSeparatorResponse.cs b/src/Lumina.Contracts/Responses/FileManagement/PathSeparatorResponse.cs
index f60fac5a..663f4d49 100644
--- a/src/Lumina.Contracts/Responses/FileManagement/PathSeparatorResponse.cs
+++ b/src/Lumina.Contracts/Responses/FileManagement/PathSeparatorResponse.cs
@@ -1,9 +1,14 @@
-namespace Lumina.Contracts.Responses.FileManagement;
+#region ========================================================================= USING =====================================================================================
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Responses.FileManagement;
///
/// Represents a response to the inquiry about the system's path separator.
///
/// The system's path separator.
+[DebuggerDisplay("{Separator}")]
public record PathSeparatorResponse(
string Separator
);
\ No newline at end of file
diff --git a/src/Lumina.Contracts/Responses/FileManagement/PathValidResponse.cs b/src/Lumina.Contracts/Responses/FileManagement/PathValidResponse.cs
new file mode 100644
index 00000000..0b72e8a5
--- /dev/null
+++ b/src/Lumina.Contracts/Responses/FileManagement/PathValidResponse.cs
@@ -0,0 +1,14 @@
+#region ========================================================================= USING =====================================================================================
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Responses.FileManagement;
+
+///
+/// Represents a response to the inquiry about the validity of a file system path.
+///
+/// Whether a file system path is valid or not.
+[DebuggerDisplay("{IsValid}")]
+public record PathValidResponse(
+ bool IsValid
+);
\ No newline at end of file
diff --git a/src/Lumina.Contracts/Responses/FileManagement/SplitPathResponse.cs b/src/Lumina.Contracts/Responses/FileManagement/SplitPathResponse.cs
index 49bfdc9d..2416699c 100644
--- a/src/Lumina.Contracts/Responses/FileManagement/SplitPathResponse.cs
+++ b/src/Lumina.Contracts/Responses/FileManagement/SplitPathResponse.cs
@@ -1,9 +1,14 @@
-namespace Lumina.Contracts.Responses.FileManagement;
+#region ========================================================================= USING =====================================================================================
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Contracts.Responses.FileManagement;
///
/// Represents a response containing the result of splitting a file system path.
///
/// The returned path segments.
+[DebuggerDisplay("{PathSegments}")]
public record SplitPathResponse(
string[] PathSegments
);
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Api/Core/Controllers/FileManagement/PathController.cs b/src/Lumina.Presentation.Api/Core/Controllers/FileManagement/PathController.cs
index 4bf7ab83..26282297 100644
--- a/src/Lumina.Presentation.Api/Core/Controllers/FileManagement/PathController.cs
+++ b/src/Lumina.Presentation.Api/Core/Controllers/FileManagement/PathController.cs
@@ -50,6 +50,29 @@ public class PathController : ApiController
return result.Match(result => Ok(result), errors => Problem(errors));
}
+ ///
+ /// Gets the path separator character of the file system.
+ ///
+ /// Cancellation token that can be used to stop the execution.
+ [HttpGet("get-path-separator")]
+ public async Task GetPathSeparator(CancellationToken cancellationToken)
+ {
+ PathSeparatorResponse result = await _mediator.Send(new GetPathSeparatorQuery(), cancellationToken).ConfigureAwait(false);
+ return Ok(result);
+ }
+
+ ///
+ /// Gets the path separator character of the file system.
+ ///
+ /// The path for which to get the parent path.
+ /// Cancellation token that can be used to stop the execution.
+ [HttpGet("get-path-parent")]
+ public async Task GetPathParent([FromQuery, ModelBinder(typeof(UrlStringBinder))] string path, CancellationToken cancellationToken)
+ {
+ ErrorOr> result = await _mediator.Send(new GetPathParentQuery(path), cancellationToken).ConfigureAwait(false);
+ return result.Match(result => Ok(result), errors => Problem(errors));
+ }
+
///
/// Combines with .
///
@@ -63,17 +86,6 @@ public class PathController : ApiController
return result.Match(result => Ok(result), errors => Problem(errors));
}
- ///
- /// Gets the path separator character of the file system.
- ///
- /// Cancellation token that can be used to stop the execution.
- [HttpGet("get-path-separator")]
- public async Task GetPathSeparator(CancellationToken cancellationToken)
- {
- PathSeparatorResponse result = await _mediator.Send(new GetPathSeparatorQuery(), cancellationToken).ConfigureAwait(false);
- return Ok(result);
- }
-
///
/// Gets the path components of .
///
@@ -85,5 +97,17 @@ public class PathController : ApiController
ErrorOr> result = await _mediator.Send(new SplitPathCommand(path), cancellationToken).ConfigureAwait(false);
return result.Match(result => Ok(result), errors => Problem(errors));
}
+
+ ///
+ /// Validates the validity of .
+ ///
+ /// The path to be validated.
+ /// Cancellation token that can be used to stop the execution.
+ [HttpGet("validate")]
+ public async Task ValidatePath([FromQuery, ModelBinder(typeof(UrlStringBinder))] string path, CancellationToken cancellationToken)
+ {
+ PathValidResponse result = await _mediator.Send(new ValidatePathQuery(path), cancellationToken).ConfigureAwait(false);
+ return Ok(result);
+ }
#endregion
}
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Common/Models/FileManagement/FileSystemTypeModel.cs b/src/Lumina.Presentation.Web/Common/Models/FileManagement/FileSystemTypeModel.cs
index 8fe57906..c668f12e 100644
--- a/src/Lumina.Presentation.Web/Common/Models/FileManagement/FileSystemTypeModel.cs
+++ b/src/Lumina.Presentation.Web/Common/Models/FileManagement/FileSystemTypeModel.cs
@@ -7,7 +7,7 @@ namespace Lumina.Presentation.Web.Common.Models.FileManagement;
///
/// Model containing the file system platform type.
-///
+/// `
[DebuggerDisplay("{PlatformType}")]
public class FileSystemTypeModel
{
diff --git a/src/Lumina.Presentation.Web/Common/Models/FileManagement/PathValidModel.cs b/src/Lumina.Presentation.Web/Common/Models/FileManagement/PathValidModel.cs
new file mode 100644
index 00000000..6cae38df
--- /dev/null
+++ b/src/Lumina.Presentation.Web/Common/Models/FileManagement/PathValidModel.cs
@@ -0,0 +1,14 @@
+#region ========================================================================= USING =====================================================================================
+using System.Diagnostics;
+#endregion
+
+namespace Lumina.Presentation.Web.Common.Models.FileManagement;
+
+///
+/// Represents a response to the inquiry about the validity of a file system path.
+///
+/// Whether a file system path is valid or not.
+[DebuggerDisplay("{IsValid}")]
+public record PathValidModel(
+ bool IsValid
+);
\ No newline at end of file
diff --git a/src/Lumina.Presentation.Web/Components/DirectoryBrowserComponent.razor b/src/Lumina.Presentation.Web/Components/DirectoryBrowserComponent.razor
index 542c4efa..c6de661f 100644
--- a/src/Lumina.Presentation.Web/Components/DirectoryBrowserComponent.razor
+++ b/src/Lumina.Presentation.Web/Components/DirectoryBrowserComponent.razor
@@ -1,40 +1,104 @@
-@using Lumina.Presentation.Web.Common.Models.UI
+@using Lumina.Presentation.Web.Common.Api
+@using Lumina.Presentation.Web.Common.Enums.FileSystem
+@using Lumina.Presentation.Web.Common.Exceptions
+@using Lumina.Presentation.Web.Common.Models.Common
+@using Lumina.Presentation.Web.Common.Models.FileManagement
+@using Lumina.Presentation.Web.Common.Models.UI
+@using Microsoft.AspNetCore.Components
+
+@inject IJSRuntime JSRuntime
+@inject IApiHttpClient _apiHttpClient