Preloading native policy type for apex-pdp
[policy/api.git] / main / src / main / java / org / onap / policy / api / main / startstop / ApiCommandLineArguments.java
index f165b16..a7c3600 100644 (file)
@@ -25,17 +25,17 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.net.URL;
 import java.util.Arrays;
+
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.DefaultParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.onap.policy.api.main.PolicyApiException;
-import org.onap.policy.api.main.PolicyApiRuntimeException;
+import org.onap.policy.api.main.exception.PolicyApiException;
+import org.onap.policy.api.main.exception.PolicyApiRuntimeException;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 
-
 /**
  * This class reads and handles command line parameters for the policy api main program.
  */
@@ -118,8 +118,7 @@ public class ApiCommandLineArguments {
         final String[] remainingArgs = commandLine.getArgs();
 
         if (remainingArgs.length > 0 && commandLine.hasOption('c') || remainingArgs.length > 0) {
-            throw new PolicyApiException(
-                    "too many command line arguments specified : " + Arrays.toString(args));
+            throw new PolicyApiException("too many command line arguments specified : " + Arrays.toString(args));
         }
 
         if (remainingArgs.length == 1) {
@@ -127,7 +126,7 @@ public class ApiCommandLineArguments {
         }
 
         if (commandLine.hasOption('h')) {
-            return help(Main.class.getCanonicalName());
+            return help(Main.class.getName());
         }
 
         if (commandLine.hasOption('v')) {
@@ -235,12 +234,5 @@ public class ApiCommandLineArguments {
         if (!theFile.exists()) {
             throw new PolicyApiException(fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" does not exist");
         }
-        if (!theFile.isFile()) {
-            throw new PolicyApiException(
-                    fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" is not a normal file");
-        }
-        if (!theFile.canRead()) {
-            throw new PolicyApiException(fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" is ureadable");
-        }
     }
 }