Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new backend “file” API for non-configuration files (separate from the file-tree API) and updates the frontend editor to load non-XML files with an appropriate Monaco language based on content type, alongside several API route/DTO refactors.
Changes:
- Added
FileService+FileControllerto read/write/move/delete non-configuration files and expose file MIME type. - Refactored file-tree and configuration endpoints/routes/DTOs and updated related frontend service calls.
- Updated the editor to cache file content with type and set Monaco language dynamically for non-XML files.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 22 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/org/frankframework/flow/file/FileTreeServiceTest.java | Updates tests for renamed package/service wiring and new folder/file handling split. |
| src/test/java/org/frankframework/flow/datamapper/DatamapperGeneratorServiceTest.java | Adjusts imports/formatting after file-tree package move. |
| src/test/java/org/frankframework/flow/datamapper/DatamapperConfigServiceTest.java | Updates expectations around configuration tree failures. |
| src/test/java/org/frankframework/flow/configuration/ConfigurationServiceTest.java | Updates tests for new ConfigurationService signatures/return types. |
| src/test/java/org/frankframework/flow/configuration/ConfigurationControllerTest.java | Updates controller tests for new routes and DTO changes. |
| src/main/java/org/frankframework/flow/project/ProjectService.java | Simplifies git-repo detection logic using new toAbsolutePath signature. |
| src/main/java/org/frankframework/flow/filetree/FileTreeController.java | Removes old file-tree controller (moved/refactored). |
| src/main/java/org/frankframework/flow/filetree/FileRenameDTO.java | Removes old DTO (replaced under flow.file). |
| src/main/java/org/frankframework/flow/filetree/FileCreateDTO.java | Removes old DTO (replaced under flow.file). |
| src/main/java/org/frankframework/flow/filesystem/LocalFileSystemStorageService.java | Adds readFileType via Files.probeContentType. |
| src/main/java/org/frankframework/flow/filesystem/FileSystemStorage.java | Extends interface with readFileType; changes toAbsolutePath signature. |
| src/main/java/org/frankframework/flow/filesystem/CloudFileSystemStorageService.java | Adds readFileType; adjusts error handling and toAbsolutePath signature. |
| src/main/java/org/frankframework/flow/file/NodeType.java | Moves enum to new flow.file package. |
| src/main/java/org/frankframework/flow/file/FolderCreateDTO.java | Adds DTO for folder creation in new file-tree controller. |
| src/main/java/org/frankframework/flow/file/FileTreeService.java | Refactors to depend on FileService; removes file CRUD in favor of dedicated service. |
| src/main/java/org/frankframework/flow/file/FileTreeNode.java | Moves node model to new flow.file package. |
| src/main/java/org/frankframework/flow/file/FileTreeController.java | Adds new file-tree controller with updated routes. |
| src/main/java/org/frankframework/flow/file/FileService.java | Adds new service for file read/write/move/delete and project-bound validation. |
| src/main/java/org/frankframework/flow/file/FileRenameDTO.java | Adds DTO for file move/rename in new file controller. |
| src/main/java/org/frankframework/flow/file/FileDTO.java | Adds DTO returning file content plus detected MIME type. |
| src/main/java/org/frankframework/flow/file/FileController.java | Adds new controller exposing file CRUD endpoints. |
| src/main/java/org/frankframework/flow/datamapper/DatamapperGeneratorService.java | Updates file-tree import and simplifies toAbsolutePath usage. |
| src/main/java/org/frankframework/flow/datamapper/DatamapperConfigService.java | Returns empty string when datamapper config is auto-created. |
| src/main/java/org/frankframework/flow/configuration/ConfigurationService.java | Refactors configuration read/update/create APIs and return types. |
| src/main/java/org/frankframework/flow/configuration/ConfigurationPathDTO.java | Removes DTO in favor of query-param based API. |
| src/main/java/org/frankframework/flow/configuration/ConfigurationController.java | Refactors routes to query params and returns XmlDTO for create/update. |
| src/main/frontend/app/utils/api.ts | Makes ApiError.messages optional and improves error message fallback. |
| src/main/frontend/app/stores/editor-tab-store.ts | Refactors type import to use a named type import. |
| src/main/frontend/app/services/file-tree-service.ts | Updates file-tree endpoints and removes file CRUD calls from this service. |
| src/main/frontend/app/services/file-service.ts | Adds frontend client for new backend file CRUD/type endpoints. |
| src/main/frontend/app/services/configuration-service.ts | Refactors configuration requests to new endpoints/query params. |
| src/main/frontend/app/routes/editor/editor.tsx | Loads non-XML files via new file API and sets Monaco language dynamically. |
| src/main/frontend/app/routes/configurations/configuration-manager.tsx | Switches delete action to the new file delete API. |
| src/main/frontend/app/routes/configurations/add-configuration-modal.tsx | Switches configuration creation to new configuration API helper. |
| src/main/frontend/app/components/file-structure/use-studio-context-menu.ts | Updates create/rename/delete actions to new services/endpoints. |
| src/main/frontend/app/components/file-structure/use-file-tree-context-menu.ts | Updates create/rename/delete actions to new services/endpoints. |
Comments suppressed due to low confidence (1)
src/main/java/org/frankframework/flow/file/FileTreeService.java:23
- Unused imports (
ConfigurationService,ApiException,FileAlreadyExistsException) remain after refactor. In Java this is a compilation error, so please remove any imports that are no longer referenced.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/org/frankframework/flow/configuration/ConfigurationControllerTest.java
Show resolved
Hide resolved
src/main/frontend/app/components/file-structure/use-studio-context-menu.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 37 out of 37 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/org/frankframework/flow/configuration/ConfigurationService.java
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/configuration/ConfigurationService.java
Show resolved
Hide resolved
src/main/java/org/frankframework/flow/datamapper/DatamapperGeneratorService.java
Show resolved
Hide resolved
src/test/java/org/frankframework/flow/datamapper/DatamapperConfigServiceTest.java
Outdated
Show resolved
Hide resolved
|
|
||
| try { | ||
| validateWithinProject(projectName, path); | ||
| if (!Files.exists(filePath)) { |
Check warning
Code scanning / SonarCloud
Accessing files should not lead to filesystem oracle attacks Medium
There was a problem hiding this comment.
But but but, validateWithinProject is right above there...
|
istg copilot dont you dare |
|




Creates a new controller and service for managing non-configuration files
Also adds support for content type of the files in monaco editor
A lot of small changes related to behaviour and maintainability, its nowhere near perfect as I have plenty to go through still