Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

Refactor Path Handling

Open Ludy87 opened this issue 10 months ago β€’ 4 comments

Description of Changes

Please provide a summary of the changes, including:

What was changed:

  • Refactored path constructions in multiple classes (e.g., SPDFApplication.java, InstallationPathConfig.java, RuntimePathConfig.java) to use Java NIO’s Paths.get() and Path.of() instead of manual string concatenation.

Why the change was made:

  • To improve code readability, maintainability, and robustness by leveraging modern Java NIO utilities.
  • To ensure better portability across different operating systems by avoiding hardcoded file separators.

Challenges encountered:

  • Maintaining backward compatibility while transitioning from manual string concatenation to using Paths for file path construction.
  • Ensuring that the refactored path resolution works consistently across all supported environments (Windows, macOS, Linux, and Docker).

@Frooodle can you check the docker path /.dockerenv?


Checklist

General

Documentation

UI Changes (if applicable)

  • [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • [ ] I have tested my changes locally. Refer to the Testing Guide for more details.

Ludy87 avatar Feb 23 '25 22:02 Ludy87

/deploypr

Frooodle avatar Feb 23 '25 22:02 Frooodle

πŸš€ PR Test Deployment

Your PR has been deployed for testing!

πŸ”— Test URL: http://185.252.234.121:3041

This deployment will be automatically cleaned up when the PR is closed.

github-actions[bot] avatar Feb 23 '25 22:02 github-actions[bot]

/deploypr

Ludy87 avatar Feb 23 '25 23:02 Ludy87

πŸš€ PR Test Deployment

Your PR has been deployed for testing!

πŸ”— Test URL: http://185.252.234.121:3041

This deployment will be automatically cleaned up when the PR is closed.

github-actions[bot] avatar Feb 23 '25 23:02 github-actions[bot]