From 7b3da3909828d2cb95c5026fdf7408b9ae2704b4 Mon Sep 17 00:00:00 2001 From: emarx Date: Wed, 7 Sep 2016 16:28:35 +0200 Subject: [PATCH] fixing bug on setting directory containing hyphen. --- kbox.kibe/src/main/java/org/aksw/kbox/kibe/KBox.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kbox.kibe/src/main/java/org/aksw/kbox/kibe/KBox.java b/kbox.kibe/src/main/java/org/aksw/kbox/kibe/KBox.java index a949595..ae2cf75 100644 --- a/kbox.kibe/src/main/java/org/aksw/kbox/kibe/KBox.java +++ b/kbox.kibe/src/main/java/org/aksw/kbox/kibe/KBox.java @@ -144,7 +144,8 @@ public static void main(String[] args) throws Exception { removeKNS(new URL(knsURL)); logger.info("KNS removed."); } else if (commands.containsKey(RESOURCE_DIR_COMMAND)) { - String resourceDir = commands.get(RESOURCE_DIR_COMMAND); + String resourceDir = commands.get(RESOURCE_DIR_COMMAND); + logger.info(resourceDir); if(resourceDir != null) { try { setResourceFolder(resourceDir); @@ -227,14 +228,15 @@ public static void removeKNS(URL url) { /** * Command line parser. + * * @param args a set o arguments received by command line * @return a Map containing the parsed arguments */ public static Map parse(String[] args) { Map map = new HashMap(); for(int i = 0; i < args.length ; i++) { - if(args[i].contains("-")) { // is a command - if(i+1 < args.length && !args[i+1].contains("-")) { + if(args[i].startsWith("-")) { // is a command + if(i+1 < args.length && !args[i+1].startsWith("-")) { map.put(args[i], args[i+1]); } else { map.put(args[i], null);