I have a requirement in which I am reading from a config file using Java function :
My config file contain these data:
PRE|X8AR01013001010000149U
PRE|Y90BV0001100002000049U
POS|1ABCDEFRI0002000789GHJK
POS|00A0000110000200000082U
I wrote this function :
After returning this value I am comparing with another String. If it is matching -- pass the flow otherwise reject
But After if I have to return 'something' , here, i return "0".
With this even if condition is not matching , it is passing the flow.
What supposed to Pass in return
1- return st -- even if bit is 0 , it is not allowing the flow
2- return 0 - passing flow in all cases
3- return null - not allowing the flow
Here is the code :
public String sux_getSpMobilePostPaidVasValue(ExecutionContext ectx, Object[] args) throws IOException {
final String AG_HOME = System.getProperty("AG_HOME");
String resource = AG_HOME +
"conf/subscriber_content_restriction.conf";
File file = new File(resource);
BufferedReader br = new BufferedReader(new FileReader(file));
String st;
while ((st = br.readLine()) != null)
if (st.startsWith("POS")) {
String stPre = st.substring(4, 5);
if (stPre == "0") {
return "0";
}
}
return "0"; // When I am not returning it is giving me compile time error
}
Is there any way to achieve this ?