- try (Stream<String> stream = Files.lines(Paths.get(xacmlProtoFilename))) {
- return stream.map(s -> s.replaceAll("UNIQUE_ID", uniqueId))
- .map(s -> s.replaceAll("CONTROL_LOOP_ONE", cLOne))
- .map(s -> s.replaceAll("CONTROL_LOOP_TWO", cLTwo))
- .collect(Collectors.joining(System.lineSeparator()));
- } catch (IOException e) {
- throw new
- ToscaPolicyConversionException("Error while generating XACML policy for coordination directive", e);
+ var policyXml = ResourceUtils.getResourceAsString(xacmlProtoFilename);
+ if (policyXml == null) {
+ throw new ToscaPolicyConversionException("Unable to find prototype " + xacmlProtoFilename);