| .. | .. |
|---|
| 1 | 1 | package net.curisit.securis.services.helpers; |
|---|
| 2 | 2 | |
|---|
| 3 | 3 | import java.io.File; |
|---|
| 4 | | -import java.io.FileWriter; |
|---|
| 5 | 4 | import java.io.IOException; |
|---|
| 6 | 5 | import java.nio.file.Files; |
|---|
| 7 | 6 | import java.util.Date; |
|---|
| .. | .. |
|---|
| 17 | 16 | import net.curisit.securis.security.BasicSecurityContext; |
|---|
| 18 | 17 | import net.curisit.securis.services.exception.SeCurisServiceException; |
|---|
| 19 | 18 | |
|---|
| 20 | | -import org.apache.commons.io.IOUtils; |
|---|
| 19 | +import org.apache.commons.io.FileUtils; |
|---|
| 20 | +import org.apache.logging.log4j.LogManager; |
|---|
| 21 | +import org.apache.logging.log4j.Logger; |
|---|
| 21 | 22 | |
|---|
| 22 | 23 | @Singleton |
|---|
| 23 | 24 | public class LicenseHelper { |
|---|
| 25 | + |
|---|
| 26 | + private static final Logger LOG = LogManager.getLogger(LicenseHelper.class); |
|---|
| 24 | 27 | |
|---|
| 25 | 28 | @Inject |
|---|
| 26 | 29 | private UserHelper userHelper; |
|---|
| .. | .. |
|---|
| 58 | 61 | public File createTemporaryLicenseFile(License lic, String licFileName) throws IOException { |
|---|
| 59 | 62 | File f = Files.createTempDirectory("securis-server").toFile(); |
|---|
| 60 | 63 | f = new File(f, licFileName); |
|---|
| 61 | | - IOUtils.write(lic.getLicenseData(), new FileWriter(f)); |
|---|
| 64 | + FileUtils.writeStringToFile(f, lic.getLicenseData()); |
|---|
| 62 | 65 | return f; |
|---|
| 63 | 66 | } |
|---|
| 64 | 67 | } |
|---|