diff options
Diffstat (limited to 'ecomp-portal-widget-ms/widget-ms/src/main')
-rw-r--r-- | ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java | 6 |
1 files changed, 4 insertions, 2 deletions
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); |