diff --git a/platform/execution-impl/src/com/intellij/execution/target/eel/EelTargetEnvironmentRequest.kt b/platform/execution-impl/src/com/intellij/execution/target/eel/EelTargetEnvironmentRequest.kt index 520c21f1c99a..0925d3afe749 100644 --- a/platform/execution-impl/src/com/intellij/execution/target/eel/EelTargetEnvironmentRequest.kt +++ b/platform/execution-impl/src/com/intellij/execution/target/eel/EelTargetEnvironmentRequest.kt @@ -28,12 +28,14 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import org.jetbrains.annotations.ApiStatus +import org.jetbrains.annotations.ApiStatus.Internal import java.net.InetSocketAddress import java.net.Socket import java.nio.file.Path import java.util.* import java.util.concurrent.ConcurrentHashMap import javax.swing.Icon +import kotlin.io.path.pathString private fun EelPlatform.toTargetPlatform(): TargetPlatform = when (this) { is EelPlatform.Posix -> TargetPlatform(Platform.UNIX) @@ -104,7 +106,8 @@ class EelTargetEnvironmentRequest(override val configuration: Configuration) : B override var shouldCopyVolumes: Boolean = false } -private class EelTargetEnvironment(override val request: EelTargetEnvironmentRequest) : TargetEnvironment(request) { +@Internal +class EelTargetEnvironment(override val request: EelTargetEnvironmentRequest) : TargetEnvironment(request) { private val myUploadVolumes: MutableMap = HashMap() private val myDownloadVolumes: MutableMap = HashMap() private val myTargetPortBindings: MutableMap = HashMap() @@ -186,7 +189,7 @@ private class EelTargetEnvironment(override val request: EelTargetEnvironmentReq override val targetRoot: String, ) : UploadableVolume, DownloadableVolume { private fun targetRootPath(): Path { - return eel.mapper.toNioPath(eel.fs.getPath(targetRoot)) + return eel.fs.toNioFs().getPath(eel.fs.getPath(targetRoot).toString()) } override fun upload(relativePath: String, targetProgressIndicator: TargetProgressIndicator) { @@ -194,6 +197,7 @@ private class EelTargetEnvironment(override val request: EelTargetEnvironmentReq val to = targetRootPath().resolve(relativePath).normalize() if (from == to) return // TODO: generalize com.intellij.execution.wsl.ijent.nio.IjentWslNioFileSystemProvider.copy + // TODO: For Docker it might be problematic to copy the owner attribute EelPathUtils.walkingTransfer(from, to, removeSource = false, copyAttributes = true) } @@ -202,11 +206,13 @@ private class EelTargetEnvironment(override val request: EelTargetEnvironmentReq val to = localRoot.resolve(relativePath).normalize() if (from == to) return // TODO: generalize com.intellij.execution.wsl.ijent.nio.IjentWslNioFileSystemProvider.copy + // TODO: For Docker it might be problematic to copy the owner attribute EelPathUtils.walkingTransfer(from, to, removeSource = false, copyAttributes = true) } override fun resolveTargetPath(relativePath: String): String { - return eel.mapper.getOriginalPath(targetRootPath().resolve(relativePath))!!.toString() + val from = targetRootPath().resolve(relativePath) + return eel.mapper.getOriginalPath(from)?.toString() ?: from.pathString } companion object {