| .. | .. |
|---|
| 71 | 71 | byte[] json; |
|---|
| 72 | 72 | try { |
|---|
| 73 | 73 | json = JsonUtils.toJSON(req, true).getBytes("utf-8"); |
|---|
| 74 | | - Files.write(Paths.get(file.toURI()), json, StandardOpenOption.CREATE); |
|---|
| 74 | + Files.write(Paths.get(file.toURI()), json, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); |
|---|
| 75 | 75 | } catch (UnsupportedEncodingException e) { |
|---|
| 76 | 76 | log.error("Error creating json doc from request: " + req, e); |
|---|
| 77 | 77 | throw new SeCurisException("Error creating json doc from request: " + req, e); |
|---|
| .. | .. |
|---|
| 80 | 80 | throw new SeCurisException("Error creating request file: " + file, e); |
|---|
| 81 | 81 | } |
|---|
| 82 | 82 | |
|---|
| 83 | | - log.info("License saved in {}", file); |
|---|
| 83 | + log.debug("License saved in {}", file); |
|---|
| 84 | 84 | |
|---|
| 85 | 85 | } |
|---|
| 86 | 86 | |
|---|
| 87 | 87 | private String getCrcLogo() { |
|---|
| 88 | 88 | String logResource = "images/logo_customer.png"; |
|---|
| 89 | 89 | InputStream is = getClass().getClassLoader().getResourceAsStream(logResource); |
|---|
| 90 | + if (is == null) |
|---|
| 91 | + return null; |
|---|
| 90 | 92 | try { |
|---|
| 91 | 93 | String shaLogo = LicUtils.sha256(IOUtils.toByteArray(is), LOGO_SECRET); |
|---|
| 92 | 94 | return shaLogo; |
|---|