From: Dan Timoney Date: Thu, 21 Sep 2017 17:42:35 +0000 (+0000) Subject: Merge "Add RPCs for vCPE" X-Git-Tag: v1.2.1~34 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=sdnc%2Fnorthbound.git;a=commitdiff_plain;h=41b8ad74ae947dba387994e4169d4f664612cb34;hp=-c Merge "Add RPCs for vCPE" --- 41b8ad74ae947dba387994e4169d4f664612cb34 diff --combined generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiUtil.java index 6e6da0e4,ca95e79c..c03bc120 --- a/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiUtil.java +++ b/generic-resource-api/provider/src/main/java/org/onap/sdnc/northbound/GenericResourceApiUtil.java @@@ -22,15 -22,23 +22,15 @@@ public class GenericResourceApiUtil ext File file = new File(PROPERTIES_FILE); properties = new Properties(); - InputStream input = null; - if (file.isFile() && file.canRead()) { - try { - input = new FileInputStream(file); + if(file.isFile() && file.canRead()) { + try(InputStream input = new FileInputStream(file)){ properties.load(input); LOG.info("Loaded properties from " + PROPERTIES_FILE ); setYangMappingProperties(properties); + } catch (IOException e) { + LOG.error("Failed to close properties file " + PROPERTIES_FILE +"\n",e); } catch (Exception e) { LOG.error("Failed to load properties " + PROPERTIES_FILE +"\n",e); - } finally { - if (input != null) { - try { - input.close(); - } catch (IOException e) { - LOG.error("Failed to close properties file " + PROPERTIES_FILE +"\n",e); - } - } } } } @@@ -40,8 -48,8 +40,8 @@@ // Trick class loader into loading builders. Some of // these will be needed later by Reflection classes, but need // to explicitly "new" them here to get class loader to load them. - org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.ecomp.model.information.EcompModelInformationBuilder u1 = - new org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.ecomp.model.information.EcompModelInformationBuilder(); + org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.onap.model.information.OnapModelInformationBuilder u1 = + new org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.onap.model.information.OnapModelInformationBuilder(); org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.network.assignments.NetworkAssignmentsBuilder u2 = new org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.network.assignments.NetworkAssignmentsBuilder(); org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.network.information.NetworkInformationBuilder u3 =