Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
knowledge-platform
Commits
31d64818
Unverified
Commit
31d64818
authored
2 years ago
by
Anil Gupta
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #834 from Jayaprakash8887/SB29808
Issue #SB-29808 fix: Review API failing
parents
ffd111db
17a470fd
release-5.3.0
AmiableAnil-patch-1
Gcloud_copy
Gcloud_fix
Remove_unwantedCode_Gcloud_fix
bulk-upload-comptenecy-mapping
bulk-upload-excelsheet
bulk-upload-test_excel
bulk_upload
csp-migration
dependabot/maven/platform-core/platform-telemetry/ch.qos.logback-logback-core-1.2.9
dependabot/maven/search-api/search-core/org.apache.httpcomponents-httpclient-4.5.13
knowlg-friday
knowlg-oneclick
local-setup-kube
master
patch-1
patch-2
patch-3
poc_bulk_upload
rahul_bulk_upload_postgres
release-4.10.0
release-4.10.1
release-4.9.0
release-4.9.1
release-5.0.0
release-5.0.1
release-5.1.0
release-5.1.0-content
release-5.2.0
release-5.2.0_RC2
release-5.2.0_RC1
release-5.1.0_RC1
release-5.0.0_RC2
release-5.0.0_RC1
release-4.10.0_RC2
release-4.10.0_RC1
release-4.9.1_RC1
release-4.9.0_RC8
release-4.9.0_RC7
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platform-modules/mimetype-manager/src/main/scala/org/sunbird/mimetype/ecml/processor/LocalizeAssetProcessor.scala
+2
-4
...bird/mimetype/ecml/processor/LocalizeAssetProcessor.scala
with
2 additions
and
4 deletions
+2
-4
platform-modules/mimetype-manager/src/main/scala/org/sunbird/mimetype/ecml/processor/LocalizeAssetProcessor.scala
+
2
−
4
View file @
31d64818
...
...
@@ -7,7 +7,6 @@ import org.apache.commons.lang3.StringUtils
import
org.sunbird.cloudstore.StorageService
import
org.sunbird.common.Platform
import
org.sunbird.common.exception.ClientException
import
org.sunbird.telemetry.logger.TelemetryManager
import
scala.concurrent.
{
Await
,
ExecutionContext
,
Future
}
import
scala.concurrent.duration.Duration
...
...
@@ -57,19 +56,18 @@ trait LocalizeAssetProcessor extends IProcessor {
def
getUrlWithPrefix
(
src
:
String
)
=
{
if
(
StringUtils
.
isNotBlank
(
src
)
&&
!
src
.
startsWith
(
"http"
))
{
if
(
src
.
contains
(
"content-plugins
/"
))
PLUGIN_MEDIA_BASE_URL
+
File
.
separator
+
src
else
CONTENT
_MEDIA_BASE_URL
+
src
if
(
!
src
.
startsWith
(
"
/"
))
PLUGIN_MEDIA_BASE_URL
+
File
.
separator
+
src
else
PLUGIN
_MEDIA_BASE_URL
+
src
}
else
src
}
def
downloadFile
(
downloadPath
:
String
,
fileUrl
:
String
)
:
File
=
try
{
TelemetryManager
.
info
(
"LocalizeAssetProcessor:: downloadFile:: fileUrl:: "
+
fileUrl
)
createDirectory
(
downloadPath
)
val
file
=
new
File
(
downloadPath
+
File
.
separator
+
getFileNameFromURL
(
fileUrl
))
FileUtils
.
copyURLToFile
(
new
URL
(
fileUrl
),
file
)
file
}
catch
{
case
e
:
IOException
=>
{
TelemetryManager
.
info
(
"LocalizeAssetProcessor:: downloadFile:: IOException:: "
+
e
.
getMessage
)
e
.
printStackTrace
(
)
throw
new
ClientException
(
"ERR_INVALID_FILE_URL"
,
"Please Provide Valid File Url!"
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets