aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-08 16:45:43 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-08 16:47:37 +0530
commit7293d08fcfecc5c66310303a8351f9efd219247e (patch)
treedf563ad1dddcaf4f6f61358615ebaf4325c949e3 /main/src
parent1fb14913426397d0313890b357ad5bf6ad11f3c7 (diff)
Add CLI_DEV
While working on the commands implementation CLI_DEV env can be used to refresh the YAML everytime cli is ran CLI-2 Change-Id: Ic267f3f4eba7f8bd653eee9c82269d154a44e05c Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/org/onap/cli/main/OnapCli.java2
-rw-r--r--main/src/main/java/org/onap/cli/main/utils/OnapCliUtils.java8
2 files changed, 7 insertions, 3 deletions
diff --git a/main/src/main/java/org/onap/cli/main/OnapCli.java b/main/src/main/java/org/onap/cli/main/OnapCli.java
index c175f67b..0920f84b 100644
--- a/main/src/main/java/org/onap/cli/main/OnapCli.java
+++ b/main/src/main/java/org/onap/cli/main/OnapCli.java
@@ -19,9 +19,7 @@ package org.onap.cli.main;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.onap.cli.fw.OnapCommand;
diff --git a/main/src/main/java/org/onap/cli/main/utils/OnapCliUtils.java b/main/src/main/java/org/onap/cli/main/utils/OnapCliUtils.java
index be88aed0..3ab4cceb 100644
--- a/main/src/main/java/org/onap/cli/main/utils/OnapCliUtils.java
+++ b/main/src/main/java/org/onap/cli/main/utils/OnapCliUtils.java
@@ -261,7 +261,13 @@ public class OnapCliUtils {
private static String readTextStringFromUrl(String input, String argName) throws OnapCliInvalidArgument {
try {
- return FileUtils.readFileToString(new File(input));
+ File file = new File(input);
+ if (file.isFile()) {
+ return FileUtils.readFileToString(file);
+ } else {
+ return input;
+ }
+
} catch (IOException e) {
throw new OnapCliInvalidArgument(argName, e);
}