aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Rogan Creswick <creswick@gmail.com>2013-06-16 13:41:59 -0700
committerGravatar Rogan Creswick <creswick@gmail.com>2013-06-16 13:41:59 -0700
commitb5604498ce494199268290433960858266e67b10 (patch)
tree28ac089279dfb5dfb568fec76ba8fbc7ccc29091
parentf46c545a6f580a0fe6fa4389698008ba012adebe (diff)
made the ruleSet path in run descriptions resolve relative to the json file specifying the run description params
-rw-r--r--doc/manual_src/headlessFiveUI.md1
-rw-r--r--src/batchtools/headless/src/main/java/com/galois/fiveui/HeadlessRunDescription.java4
2 files changed, 5 insertions, 0 deletions
diff --git a/doc/manual_src/headlessFiveUI.md b/doc/manual_src/headlessFiveUI.md
index 461f041..c984a17 100644
--- a/doc/manual_src/headlessFiveUI.md
+++ b/doc/manual_src/headlessFiveUI.md
@@ -158,6 +158,7 @@ The format of a run configuration is as follows:
*/
{
'rulePath' : '<path>', // path = the path where rule set files referenced below live.
+ // rulePath is relative to the run description file.
'crawlType' : '<d> <n> <p> <pat>', // d = crawl depth, n = max number of pages to retrieve.
// p = politeness delay (ms), pat = URL glob pattern
// (crawlType can also be 'none').
diff --git a/src/batchtools/headless/src/main/java/com/galois/fiveui/HeadlessRunDescription.java b/src/batchtools/headless/src/main/java/com/galois/fiveui/HeadlessRunDescription.java
index 92f2ef1..c9b70de 100644
--- a/src/batchtools/headless/src/main/java/com/galois/fiveui/HeadlessRunDescription.java
+++ b/src/batchtools/headless/src/main/java/com/galois/fiveui/HeadlessRunDescription.java
@@ -110,6 +110,10 @@ public class HeadlessRunDescription {
if (json.isJsonObject()) { // check if the description is an extended one
JsonObject obj = json.getAsJsonObject();
ruleSetDir = objGetString(obj, "rulePath");
+ String runDescDir = new File(_fn).getParent();
+ if (null != runDescDir) {
+ ruleSetDir = runDescDir + File.separator + ruleSetDir;
+ }
_crawlType = objGetString(obj, "crawlType");
arr = obj.get("runs").getAsJsonArray();
} else if (json.isJsonArray()) {