Enhance configuration file handling, validate filename input and adjust paths#554
Enhance configuration file handling, validate filename input and adjust paths#554stijnpotters1 wants to merge 3 commits into
Conversation
…st path resolution
Matthbo
left a comment
There was a problem hiding this comment.
Let's discuss this PR next time we're both available
Signed-off-by: Stijn Potters <stijn.potters1@gmail.com>
…oved clarity and consistency
|
| public String addConfiguration(String projectName, String configurationName) throws IOException, ApiException, TransformerException, ParserConfigurationException, SAXException { | ||
| ConfigurationProject configurationProject = configurationProjectService.getProject(projectName); | ||
| Path absProjectPath = fileSystemStorage.toAbsolutePath(configurationProject.getRootPath()); | ||
| Path configDir = absProjectPath.resolve(CONFIGURATIONS_DIR).normalize(); |
There was a problem hiding this comment.
Why remove the 'src/main/configurations' base path?
There was a problem hiding this comment.
Because in the flow a configuration is opened which is already inside the src/main/configurations directory. So we do not have to set the additional src/main/configurations folder structure inside the configuration to add another configuration file.
There was a problem hiding this comment.
Ah so this has nothing to do with creating or opening a configuration?
We do want to enforce projects to put their configuration in <root>/src/main/configurations/<configuration name>/configuration.xml or later whatever the default name is for configuration.xml
There was a problem hiding this comment.
No it is for adding a file to a configuration, not the configuration itself



Configuration overview now shows default Configuration.xml file that is created on default after creating a new configuration.

Added validation so you cannot end file or path with '/'

