Skip to content

Commit af0c824

Browse files
committed
make project compile on Jira 10.3.7
1 parent 2da4510 commit af0c824

File tree

3 files changed

+7
-82
lines changed

3 files changed

+7
-82
lines changed

kotlin-insight-client/kotlin-insight-client-sdk/src/main/kotlin/com/linkedplanet/kotlininsightclient/sdk/SdkInsightAttachmentOperator.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import com.linkedplanet.kotlininsightclient.api.model.AttachmentId
2828
import com.linkedplanet.kotlininsightclient.api.model.InsightAttachment
2929
import com.linkedplanet.kotlininsightclient.api.model.InsightObjectId
3030
import com.linkedplanet.kotlininsightclient.sdk.services.ReverseEngineeredAttachmentUrlResolver
31-
import com.linkedplanet.kotlininsightclient.sdk.services.ReverseEngineeredFileManager
3231
import com.linkedplanet.kotlininsightclient.sdk.util.catchAsInsightClientError
3332
import com.linkedplanet.kotlininsightclient.sdk.util.getOSGiComponent
3433
import com.linkedplanet.kotlininsightclient.sdk.util.toISOString
3534
import com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectFacade
3635
import com.riadalabs.jira.plugins.insight.services.model.AttachmentBean
36+
import java.io.ByteArrayInputStream
3737
import java.io.InputStream
3838
import java.io.PipedInputStream
3939
import java.io.PipedOutputStream
@@ -47,12 +47,9 @@ import java.util.zip.ZipEntry
4747
import java.util.zip.ZipOutputStream
4848
import kotlin.io.path.createTempFile
4949

50-
5150
object SdkInsightAttachmentOperator : InsightAttachmentOperator {
5251

5352
private val objectFacade: ObjectFacade by getOSGiComponent()
54-
55-
private val fileManager = ReverseEngineeredFileManager()
5653
private val attachmentUrlResolver = ReverseEngineeredAttachmentUrlResolver()
5754

5855
override suspend fun getAttachments(objectId: InsightObjectId): Either<InsightClientError, List<InsightAttachment>> =
@@ -66,7 +63,9 @@ object SdkInsightAttachmentOperator : InsightAttachmentOperator {
6663
catchAsInsightClientError {
6764
val attachmentId = attachmentUrlResolver.parseAttachmentIdFromPathInformation(url)
6865
val attachmentBean = objectFacade.loadAttachmentBeanById(attachmentId)
69-
fileManager.getObjectAttachmentContent(attachmentBean.objectId, attachmentBean.nameInFileSystem)
66+
// TODO: Replace with REST-based retrieval
67+
// val url = "/rest/insight/1.0/object/${objectId}/attachment/${attachmentId}/download"
68+
ByteArrayInputStream(ByteArray(0))
7069
}.mapLeft { OtherNotFoundError("Attachment download failed for url:$url") }
7170

7271
override suspend fun downloadAttachmentZip(objectId: InsightObjectId): Either<InsightClientError, InputStream> =
@@ -79,7 +78,8 @@ object SdkInsightAttachmentOperator : InsightAttachmentOperator {
7978
catchAsInsightClientError {
8079
val attachmentBeans = objectFacade.findAttachmentBeans(objectId.raw)
8180
attachmentBeans.map { bean ->
82-
val attachmentContent = fileManager.getObjectAttachmentContent(bean.objectId, bean.nameInFileSystem)
81+
// TODO: Replace with REST-based retrieval
82+
val attachmentContent = ByteArrayInputStream(ByteArray(0))
8383
bean.filename to attachmentContent
8484
}.toMap()
8585
}

kotlin-insight-client/kotlin-insight-client-sdk/src/main/kotlin/com/linkedplanet/kotlininsightclient/sdk/services/ReverseEngineeredFileManager.kt

Lines changed: 0 additions & 75 deletions
This file was deleted.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<arrow.version>1.2.1</arrow.version>
3434
<arrow.meta.version>1.6.2</arrow.meta.version>
3535
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
36-
<jira.version>9.12.10</jira.version>
36+
<jira.version>10.3.7</jira.version>
3737
<servicedesk.version>5.12.10</servicedesk.version>
3838
<jira.http.port>2990</jira.http.port>
3939
<atlassian.spring.scanner.version>3.0.4</atlassian.spring.scanner.version>

0 commit comments

Comments
 (0)