Update app/common/src/main/java/stirling/software/common/util/GeneralUtils.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ludy 2025-07-19 02:09:22 +02:00 committed by GitHub
parent 5e86fc0d66
commit 768f695f6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -448,6 +448,10 @@ public class GeneralUtils {
* path.
*/
public static Path extractScript(String scriptName) throws IOException {
// Validate input
if (scriptName == null || scriptName.trim().isEmpty()) {
throw new IllegalArgumentException("scriptName must not be null or empty");
}
// 1. load the script from classpath
ClassPathResource resource = new ClassPathResource("static/python/" + scriptName);