| Total Complexity | 3 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.hltech.vaunt.generator.domain.representation; |
||
| 11 | @RequiredArgsConstructor |
||
| 12 | public class RepresentationWriter { |
||
| 13 | |||
| 14 | private final VauntSerializer serializer; |
||
| 15 | |||
| 16 | public void writeServiceRepresentation(Service service, String targetDirectory) throws IOException { |
||
| 17 | File targetDir = Paths.get(targetDirectory).toFile(); |
||
| 18 | if (targetDir != null && !targetDir.exists()) { |
||
| 19 | targetDir.mkdirs(); |
||
| 20 | } |
||
| 21 | |||
| 22 | File targetFile = Paths.get(targetDirectory).resolve(service.getName().concat(".json")).toFile(); |
||
| 23 | serializer.serializeToFile(targetFile, service); |
||
| 24 | } |
||
| 26 |