diff options
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src')
2 files changed, 11 insertions, 5 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/FileManagerFactory.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/FileManagerFactory.java index 7c0c1949..b23bcac4 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/FileManagerFactory.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/FileManagerFactory.java @@ -20,6 +20,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class FileManagerFactory { + + private FileManagerFactory() { + } + private static final Logger logger = LoggerFactory.getLogger(FileManagerFactory.class); private static FileManager getHttpFileManager() { @@ -51,3 +55,4 @@ public class FileManagerFactory { } } } + diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/HttpFileManagerImpl.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/HttpFileManagerImpl.java index 24090937..403c52ac 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/HttpFileManagerImpl.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/filemanage/http/HttpFileManagerImpl.java @@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory; public class HttpFileManagerImpl implements FileManager { private static final Logger LOGGER = LoggerFactory.getLogger(HttpFileManagerImpl.class); + @Override public boolean upload(String srcPath, String dstPath) { boolean flag = true; LOGGER.info("start upload file.srcPath:" + srcPath + " dstPath" + dstPath); @@ -34,8 +35,7 @@ public class HttpFileManagerImpl implements FileManager { LOGGER.error("src file not exist!"); return false; } - // File dstFile = new File(ToolUtil.getHttpServerPath() + dstPath); - // LOGGER.info("dstFile AbsolutePath:" + dstFile.getAbsolutePath()); + String targetDir = ToolUtil.getHttpServerAbsolutePath() + dstPath; try { ToolUtil.copyDirectory(srcPath, targetDir, true); @@ -47,18 +47,19 @@ public class HttpFileManagerImpl implements FileManager { return flag; } + @Override public boolean download(String srcPath, String dstPath) { // TODO Auto-generated method stub return false; } + @Override public boolean delete(String srcPath) { - boolean flag = true; LOGGER.info("start delete file from http server.srcPath:" + srcPath); - flag = ToolUtil.deleteDir(new File(ToolUtil.getHttpServerAbsolutePath() + srcPath)); + boolean flag = ToolUtil.deleteDir(new File(ToolUtil.getHttpServerAbsolutePath() + srcPath)); LOGGER.info("delete file from http server end.flag:" + flag); return flag; } - } + |