Roberto Sánchez
2014-02-24 3ef2ddd5cb1ee57317ffb757aceb86355a612a17
src/main/java/net/curisit/securis/ReqGenerator.java
....@@ -71,7 +71,7 @@
7171 byte[] json;
7272 try {
7373 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);
7575 } catch (UnsupportedEncodingException e) {
7676 log.error("Error creating json doc from request: " + req, e);
7777 throw new SeCurisException("Error creating json doc from request: " + req, e);
....@@ -80,13 +80,15 @@
8080 throw new SeCurisException("Error creating request file: " + file, e);
8181 }
8282
83
- log.info("License saved in {}", file);
83
+ log.debug("License saved in {}", file);
8484
8585 }
8686
8787 private String getCrcLogo() {
8888 String logResource = "images/logo_customer.png";
8989 InputStream is = getClass().getClassLoader().getResourceAsStream(logResource);
90
+ if (is == null)
91
+ return null;
9092 try {
9193 String shaLogo = LicUtils.sha256(IOUtils.toByteArray(is), LOGO_SECRET);
9294 return shaLogo;