From 79667d66c5284b1c66f6e8436750d1402ee6ebae Mon Sep 17 00:00:00 2001 From: amit Date: Wed, 19 Feb 2020 23:13:23 +0530 Subject: [PATCH 1/6] Issue #SC-0 feat:added file name in upload url --- .../actors/fileuploadservice/FileUploadServiceActor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java index bc14cb3a2..d60d6e147 100644 --- a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java +++ b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java @@ -47,7 +47,8 @@ private void processFileUpload(Request actorMessage) throws IOException { fileExtension = split[split.length - 1]; } } - String fName = "File-" + processId; + fileName.replace(fileExtension,""); + String fName = fileName +"-"+ processId; if (!StringUtils.isBlank(fileExtension)) { fName = fName + "." + fileExtension.toLowerCase(); ProjectLogger.log("File - " + fName + " Extension is " + fileExtension); From 0b6c2958b35e7a7f9cf530b13fbbed09d01dbd05 Mon Sep 17 00:00:00 2001 From: AMIT KUMAR Date: Wed, 19 Feb 2020 23:29:48 +0530 Subject: [PATCH 2/6] Update .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 8fd6d0edc..41635e2f1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "actors/sunbird-utils"] path = actors/sunbird-utils url = https://github.com/project-sunbird/sunbird-utils.git - branch = release-2.8.0 + branch = devcon-2020 From 7eb5983377790cac01e4e7ea72b9c0f01c72e1e3 Mon Sep 17 00:00:00 2001 From: AMIT KUMAR Date: Wed, 19 Feb 2020 23:32:22 +0530 Subject: [PATCH 3/6] Update .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 41635e2f1..9041a1a95 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "actors/sunbird-utils"] path = actors/sunbird-utils - url = https://github.com/project-sunbird/sunbird-utils.git + url = https://github.com/amit-tarento/sunbird-utils.git branch = devcon-2020 From 91803bbd276a7468c8c6ade8fe0a163130c98879 Mon Sep 17 00:00:00 2001 From: amit Date: Thu, 20 Feb 2020 00:44:50 +0530 Subject: [PATCH 4/6] Issue #SC-0 feat: asda --- .../actors/fileuploadservice/FileUploadServiceActor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java index d60d6e147..6fcb427f3 100644 --- a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java +++ b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java @@ -47,7 +47,7 @@ private void processFileUpload(Request actorMessage) throws IOException { fileExtension = split[split.length - 1]; } } - fileName.replace(fileExtension,""); + fileName = fileName.replace(fileExtension,""); String fName = fileName +"-"+ processId; if (!StringUtils.isBlank(fileExtension)) { fName = fName + "." + fileExtension.toLowerCase(); From dbd45eeb2162ce694f2e814deff9fe85a5f9954e Mon Sep 17 00:00:00 2001 From: amit Date: Thu, 20 Feb 2020 01:19:55 +0530 Subject: [PATCH 5/6] Issue #SC-0 feat: asda --- .../actors/fileuploadservice/FileUploadServiceActor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java index 6fcb427f3..41e56c593 100644 --- a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java +++ b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java @@ -47,7 +47,7 @@ private void processFileUpload(Request actorMessage) throws IOException { fileExtension = split[split.length - 1]; } } - fileName = fileName.replace(fileExtension,""); + fileName = fileName.replace("."+fileExtension,""); String fName = fileName +"-"+ processId; if (!StringUtils.isBlank(fileExtension)) { fName = fName + "." + fileExtension.toLowerCase(); From 6f52e441404aa5d00ec73391fe38ea520f302c47 Mon Sep 17 00:00:00 2001 From: amit Date: Thu, 20 Feb 2020 01:50:15 +0530 Subject: [PATCH 6/6] Issue #SC-0 feat: logger --- .../actors/fileuploadservice/FileUploadServiceActor.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java index 41e56c593..70256a3fe 100644 --- a/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java +++ b/actors/common/src/main/java/org/sunbird/learner/actors/fileuploadservice/FileUploadServiceActor.java @@ -9,10 +9,7 @@ import org.sunbird.actor.router.ActorConfig; import org.sunbird.common.exception.ProjectCommonException; import org.sunbird.common.models.response.Response; -import org.sunbird.common.models.util.ActorOperations; -import org.sunbird.common.models.util.JsonKey; -import org.sunbird.common.models.util.ProjectLogger; -import org.sunbird.common.models.util.ProjectUtil; +import org.sunbird.common.models.util.*; import org.sunbird.common.models.util.azure.CloudService; import org.sunbird.common.models.util.azure.CloudServiceFactory; import org.sunbird.common.request.Request; @@ -53,7 +50,7 @@ private void processFileUpload(Request actorMessage) throws IOException { fName = fName + "." + fileExtension.toLowerCase(); ProjectLogger.log("File - " + fName + " Extension is " + fileExtension); } - + ProjectLogger.log("File name is :: "+fName, LoggerEnum.INFO.name()); File file = new File(fName); FileOutputStream fos = null; String avatarUrl = null;