/*
 * Copyright 2000-2013 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jetbrains.ide;

import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.util.Url;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.net.URLConnection;

public abstract class BuiltInServerManager {
  public static BuiltInServerManager getInstance() {
    return ApplicationManager.getApplication().getComponent(BuiltInServerManager.class);
  }

  public abstract int getPort();

  public abstract BuiltInServerManager waitForStart();

  @Nullable
  public abstract Disposable getServerDisposable();

  public abstract boolean isOnBuiltInWebServer(@Nullable Url url);

  public abstract void configureRequestToWebServer(@NotNull URLConnection connection);

  public abstract Url addAuthToken(@NotNull Url url);
}
@@ -619,17 +619,16 @@
 ains.ide
-;
 %0A%0Aimport
@@ -659,17 +659,16 @@
 sposable
-;
 %0Aimport 
@@ -718,17 +718,16 @@
 nManager
-;
 %0Aimport 
@@ -751,94 +751,8 @@
 .Url
-;%0Aimport org.jetbrains.annotations.NotNull;%0Aimport org.jetbrains.annotations.Nullable;
 %0A%0Aim
@@ -782,18 +782,10 @@
 tion
-;
 %0A%0A
-public 
 abst
@@ -824,69 +824,87 @@
 %7B%0A  
-public static BuiltInServerManager getInstance() %7B%0A    return
+companion object %7B%0A    @JvmStatic%0A    fun getInstance(): BuiltInServerManager =
  App
@@ -973,24 +973,29 @@
 ager
-.
+::
 class
+.java
 )
-;
 %0A  %7D%0A%0A  
 publ
@@ -986,31 +986,24 @@
 ava)%0A  %7D%0A%0A  
-public 
 abstract int
@@ -1003,101 +1003,71 @@
 act 
-int getPort();%0A%0A  public abstract BuiltInServerManager waitForStart();%0A%0A  @Null
+val port: Int%0A%0A  abstract val serverDisposable: Dispos
 able
+?%0A
 %0A  
-public 
 abst
@@ -1075,51 +1075,51 @@
 act 
-Disposable getServerDisposable();%0A%0A  public
+fun waitForStart(): BuiltInServerManager%0A%0A 
  abs
@@ -1128,14 +1128,10 @@
 act 
-boolea
+fu
 n is
@@ -1153,37 +1153,30 @@
 ver(
-@Nullable Url url);%0A%0A  public
+url: Url?): Boolean%0A%0A 
  abs
@@ -1185,12 +1185,11 @@
 act 
-void
+fun
  con
@@ -1217,21 +1217,9 @@
 ver(
-@NotNull URLC
+c
 onne
@@ -1223,18 +1223,22 @@
 nnection
- c
+: URLC
 onnectio
@@ -1243,20 +1243,12 @@
 ion)
-;
 %0A%0A  
-public 
 abst
@@ -1252,19 +1252,19 @@
 bstract 
-Url
+fun
  addAuth
@@ -1273,24 +1273,20 @@
 ken(
-@NotNull Url url);
+url: Url): Url
 %0A%7D

convert BuiltInServerManager to kotlin