public class Filesystem extends Object implements Condition, Parameterized
Modifier and Type | Method and Description |
---|---|
static Filesystem |
directoryExists(File resource)
|
boolean |
evaluate(Rewrite event,
EvaluationContext context)
Evaluate this condition against the given
Rewrite event. |
static Filesystem |
fileExists(File resource)
|
ParameterizedPatternParser |
getExpression()
Get the
ParameterizedPattern of this Filesystem . |
Set<String> |
getRequiredParameterNames()
Get all required
Parameter names for this Parameterized instance. |
void |
setParameterStore(ParameterStore store)
Initialize this
Parameterized instance with the global ParameterStore . |
public boolean evaluate(Rewrite event, EvaluationContext context)
Condition
Rewrite
event. If this condition does
not apply to the given event, it must return false. If the condition applies and is satisfied, return true.public static Filesystem fileExists(File resource)
Condition
that returns true
if the given File
exists in the file-system of
the host environment, and is a normal file.
The given file path may be parameterized:
new File("/tmp/file.txt")
new File("c:\tmp\{param}.txt")
...
location
- ParameterizedPattern
specifying the location of the File
.ConfigurationRuleParameterBuilder#where(String)}
public static Filesystem directoryExists(File resource)
Condition
that returns true
if the given File
exists in the file-system of
the host environment, and is a directory.
The given file path may be parameterized:
new File("/tmp/directory/")
new File("c:\tmp\{param}")
...
location
- ParameterizedPattern
specifying the location of the directory.ConfigurationRuleParameterBuilder#where(String)}
public ParameterizedPatternParser getExpression()
ParameterizedPattern
of this Filesystem
.public Set<String> getRequiredParameterNames()
Parameterized
Parameter
names for this Parameterized
instance.getRequiredParameterNames
in interface Parameterized
public void setParameterStore(ParameterStore store)
Parameterized
Parameterized
instance with the global ParameterStore
.setParameterStore
in interface Parameterized
Copyright © 2014 OCPsoft. All Rights Reserved.