public abstract class Scripts
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ScriptSpec |
script(org.springframework.core.io.Resource scriptResource)
The factory method to produce
ScriptSpec based on the Resource . |
static ScriptSpec |
script(java.lang.String scriptLocation)
The factory method to produce
ScriptSpec based on the script file location. |
public static ScriptSpec script(org.springframework.core.io.Resource scriptResource)
ScriptSpec
based on the Resource
.
The Resource
must represent the real file and can be injected like:
@Value("com/my/project/scripts/FilterScript.groovy") private Resource filterScript;
scriptResource
- the script file Resource
public static ScriptSpec script(java.lang.String scriptLocation)
ScriptSpec
based on the script file location.scriptLocation
- the path to the script file.
file:
, ftp:
, s3:
etc.
The classpath:
can be omitted.