// The command line options
private String configurationFilePath = null;
+ private String propertyFilePath = null;
/**
* Construct the options for the CLI editor.
.required(false)
.type(String.class)
.build());
+ options.addOption(Option.builder("p")
+ .longOpt("property-file")
+ .desc("the full path to the topic property file to use, "
+ + "the property file contains the policy pap topic properties")
+ .hasArg()
+ .argName("PROP_FILE")
+ .required(false)
+ .type(String.class)
+ .build());
//@formatter:on
}
public String parse(final String[] args) throws PolicyXacmlPdpException {
// Clear all our arguments
setConfigurationFilePath(null);
+ setPropertyFilePath(null);
CommandLine commandLine = null;
try {
setConfigurationFilePath(commandLine.getOptionValue('c'));
}
+ if (commandLine.hasOption('p')) {
+ setPropertyFilePath(commandLine.getOptionValue('p'));
+ }
+
return null;
}
return configurationFilePath != null && !configurationFilePath.isEmpty();
}
+ /**
+ * Gets the property file path.
+ *
+ * @return the property file path
+ */
+ public String getPropertyFilePath() {
+ return propertyFilePath;
+ }
+
+ /**
+ * Gets the full expanded property file path.
+ *
+ * @return the property file path
+ */
+ public String getFullPropertyFilePath() {
+ return ResourceUtils.getFilePath4Resource(getPropertyFilePath());
+ }
+
+ /**
+ * Sets the property file path.
+ *
+ * @param propertyFilePath the property file path
+ */
+ public void setPropertyFilePath(final String propertyFilePath) {
+ this.propertyFilePath = propertyFilePath;
+
+ }
+
/**
* Validate readable file.
*