Skip to content

Commit

Permalink
Merge pull request #5238 from irwinsun/issue_5176
Browse files Browse the repository at this point in the history
Issue 5176
  • Loading branch information
irwinsun authored Sep 26, 2021
2 parents 2fc244d + 6cd08be commit 494f3f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@ abstract class ArchiveFileServiceImpl : ArchiveFileService {
disposition: FormDataContentDisposition,
fileChannelType: FileChannelTypeEnum
): String {
val path = generateDestPath(fileType, projectId, customFilePath, pipelineId, buildId)
val destPath = if (!path.endsWith(disposition.fileName)) {
path + fileSeparator + disposition.fileName
val destPath = if (customFilePath?.endsWith(disposition.fileName) != true) {
(customFilePath ?: "") + fileSeparator + disposition.fileName
} else {
path
customFilePath
}
val servicePipelineResource = client.get(ServicePipelineResource::class)
val pipelineName = servicePipelineResource.getPipelineNameByIds(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ class DiskArchiveFileServiceImpl : ArchiveFileServiceImpl() {
props: Map<String, String?>?,
fileChannelType: FileChannelTypeEnum
): String {
logger.info("uploadFile|filePath=$filePath|fileName=$fileName|props=$props")
val uploadFileName = fileName ?: file.name
val fileTypeStr = fileType?.fileType ?: "file"
val destPath = if (null == filePath) {
Expand All @@ -364,14 +365,14 @@ class DiskArchiveFileServiceImpl : ArchiveFileServiceImpl() {
fileType = fileType,
projectId = projectId,
customFilePath = filePath,
pipelineId = null,
buildId = null
pipelineId = props?.get("pipelineId"),
buildId = props?.get("buildId")
)
} else {
"${getBasePath()}$fileSeparator$filePath"
}
}
logger.info("$uploadFileName destPath is:$destPath")
logger.info("uploadFile|$uploadFileName destPath is:$destPath")
uploadFileToRepo(destPath, file)
val shaContent = file.inputStream().use { ShaUtils.sha1InputStream(it) }
var fileProps: Map<String, String?> = props ?: mapOf()
Expand Down

0 comments on commit 494f3f1

Please sign in to comment.