summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-widget-ms
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-portal-widget-ms')
-rw-r--r--ecomp-portal-widget-ms/widget-ms/pom.xml5
-rw-r--r--ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java6
2 files changed, 9 insertions, 2 deletions
diff --git a/ecomp-portal-widget-ms/widget-ms/pom.xml b/ecomp-portal-widget-ms/widget-ms/pom.xml
index 95b06adc..d0849df6 100644
--- a/ecomp-portal-widget-ms/widget-ms/pom.xml
+++ b/ecomp-portal-widget-ms/widget-ms/pom.xml
@@ -98,6 +98,11 @@
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>1.9</version>
</dependency>
+ <dependency>
+ <groupId>org.jsoup</groupId>
+ <artifactId>jsoup</artifactId>
+ <version>1.12.1</version>
+ </dependency>
<!-- hibernate-core depends on dom4j, which has optional dependencies.
On jenkins, contrary to doc, mvn 3.0.5 packages the optional dependencies
in the war. Workaround: exclude them explicitly. -->
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java
index 18611728..7a35ba4e 100644
--- a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java
+++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java
@@ -39,6 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
public class StorageServiceImpl implements StorageService {
private static final Logger logger = LoggerFactory.getLogger(StorageServiceImpl.class);
+ private final String TMP_PATH = "/tmp/";
@Autowired
private SessionFactory sessionFactory;
@@ -98,13 +99,14 @@ public class StorageServiceImpl implements StorageService {
throw new StorageException(
"StorageServiceImpl.checkZipFile: Failed to store empty file " + file.getOriginalFilename());
}
- String fileLocation = file.getOriginalFilename();
+
+ String fileLocation = TMP_PATH+file.getOriginalFilename();
logger.debug("StorageServiceImpl.checkZipFile: store the widget to:" + fileLocation);
convFile = new File(fileLocation);
try(FileOutputStream fos = new FileOutputStream(convFile)){
fos.write(file.getBytes());
}
- map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
+ map = unzipper.unzip_db(fileLocation, TMP_PATH, "tempWidgets");
convFile.delete();
} catch (IOException e) {
logger.error("StorageServiceImpl.checkZipFile: Failed to store file " + file.getOriginalFilename(), e);