Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Rename properties to options (because they are taken not only from pr…
Browse files Browse the repository at this point in the history
…operties)
  • Loading branch information
SerVB committed Sep 29, 2021
1 parent 3000166 commit 6109cc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import org.jetbrains.projector.common.protocol.toServer.ClientWheelEvent
import org.jetbrains.projector.common.protocol.toServer.MouseModifier
import org.jetbrains.projector.server.core.ReadyClientSettings.TouchState
import org.jetbrains.projector.server.core.convert.toClient.roundToInfinity
import org.jetbrains.projector.server.core.util.getProperty
import org.jetbrains.projector.server.core.util.getOption
import java.awt.Component
import java.awt.event.InputEvent
import java.awt.event.MouseEvent
Expand All @@ -43,7 +43,7 @@ private const val DEFAULT_SCROLL_AMOUNT = 1
private const val DEFAULT_PIXEL_PER_UNIT = "100"

public const val PIXEL_PER_UNIT_ENV_NAME: String = "ORG_JETBRAINS_PROJECTOR_SERVER_PIXEL_PER_UNIT"
private val PIXEL_PER_UNIT = getProperty(PIXEL_PER_UNIT_ENV_NAME, DEFAULT_PIXEL_PER_UNIT).toInt()
private val PIXEL_PER_UNIT = getOption(PIXEL_PER_UNIT_ENV_NAME, DEFAULT_PIXEL_PER_UNIT).toInt()

// todo: 3 is a wild guess (scaling factor of mobile devices), need to get this number from the context
private val TOUCH_PIXEL_PER_UNIT = 3 * PIXEL_PER_UNIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
*/
package org.jetbrains.projector.server.core.util

public fun getProperty(propName: String): String? {
public fun getOption(propName: String): String? {
return System.getProperty(propName) ?: System.getenv(propName)
}

public fun getProperty(propName: String, defaultValue: String): String {
return getProperty(propName) ?: defaultValue
public fun getOption(propName: String, defaultValue: String): String {
return getOption(propName) ?: defaultValue
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public const val SSL_STORE_PASSWORD: String = "STORE_PASSWORD"
public const val SSL_KEY_PASSWORD: String = "KEY_PASSWORD"

public fun setSsl(setWebSocketFactory: (WebSocketServerFactory) -> Unit): String? {
val sslPropertiesFilePath = getProperty(SSL_ENV_NAME) ?: return null
val sslPropertiesFilePath = getOption(SSL_ENV_NAME) ?: return null

try {
val properties = Properties().apply {
Expand Down

0 comments on commit 6109cc6

Please sign in to comment.