Remove Java web server

Applets don't work anymore so remove everything that has to do
with serving them.
diff --git a/win/winvnc/CMakeLists.txt b/win/winvnc/CMakeLists.txt
index ac9ae29..113796c 100644
--- a/win/winvnc/CMakeLists.txt
+++ b/win/winvnc/CMakeLists.txt
@@ -1,29 +1,18 @@
 include_directories(${CMAKE_BINARY_DIR}/win ${CMAKE_CURRENT_SOURCE_DIR})
 
-set(VNCVIEWER_JAR_PATH ${CMAKE_BINARY_DIR}/java/VncViewer.jar)
-set(INDEX_VNC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/index.vnc)
-
-configure_file(winvnc.rc.in winvnc.rc)
-
 add_executable(winvnc4 WIN32
   buildTime.cxx
   ControlPanel.cxx
-  JavaViewer.cxx
   ManagedListener.cxx
   QueryConnectDialog.cxx
   STrayIcon.cxx
   VNCServerService.cxx
   VNCServerWin32.cxx
   winvnc.cxx
-  ${CMAKE_CURRENT_BINARY_DIR}/winvnc.rc)
+  winvnc.rc)
 
 target_link_libraries(winvnc4 rfb rfb_win32 network rdr ws2_32.lib)
 
-if(BUILD_JAVA)
-  set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/winvnc.rc
-    PROPERTIES OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/java/VncViewer.jar)
-endif()
-
 install(TARGETS winvnc4
   RUNTIME DESTINATION ${BIN_DIR}
 )
diff --git a/win/winvnc/JavaViewer.cxx b/win/winvnc/JavaViewer.cxx
deleted file mode 100644
index e2e307e..0000000
--- a/win/winvnc/JavaViewer.cxx
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-#include <winvnc/JavaViewer.h>
-#include <winvnc/VNCServerWin32.h>
-#include <winvnc/resource.h>
-#include <rdr/MemInStream.h>
-#include <rfb/LogWriter.h>
-#include <rfb/VNCServerST.h>
-#include <rfb_win32/TCharArray.h>
-
-#include <windows.h>
-
-using namespace winvnc;
-using namespace rfb;
-
-
-static rfb::LogWriter vlog("JavaViewerServer");
-
-JavaViewerServer::JavaViewerServer(VNCServerWin32* svr) : server(svr) {
-}
-
-JavaViewerServer::~JavaViewerServer() {
-}
-
-rdr::InStream* JavaViewerServer::getFile(const char* name,
-                                         const char** contentType,
-                                         int* contentLength,
-                                         time_t* lastModified)
-{
-  if (strcmp(name, "/") == 0)
-    name = "/index.vnc";
-  if (strcmp(name, "/VncViewer.jar") == 0)
-    name = "VncViewer.jar";
-  if (strcmp(name, "/index.vnc") == 0)
-    name = "index.vnc";
-
-  HRSRC resource = FindResource(0, TStr(name), _T("HTTPFILE"));
-  if (!resource) return 0;
-  HGLOBAL handle = LoadResource(0, resource);
-  if (!handle) return 0;
-  void* buf = LockResource(handle);
-  int len = SizeofResource(0, resource);
-
-  rdr::InStream* is = new rdr::MemInStream(buf, len);
-  if (strlen(name) > 4 && strcasecmp(&name[strlen(name)-4], ".vnc") == 0) {
-    is = new rdr::SubstitutingInStream(is, this, 20);
-    *contentType = "text/html";
-  }
-  return is;
-}
-
-char* JavaViewerServer::substitute(const char* varName)
-{
-  if (strcmp(varName, "$$") == 0) {
-    return rfb::strDup("$");
-  }
-  if (strcmp(varName, "$PORT") == 0) {
-    char* str = new char[10];
-    sprintf(str, "%d", rfbPort);
-    return str;
-  }
-  if (strcmp(varName, "$WIDTH") == 0) {
-    char* str = new char[10];
-    sprintf(str, "%d", server->getDesktopSize().x);
-    return str;
-  }
-  if (strcmp(varName, "$HEIGHT") == 0) {
-    char* str = new char[10];
-    sprintf(str, "%d", server->getDesktopSize().y);
-    return str;
-  }
-  if (strcmp(varName, "$APPLETWIDTH") == 0) {
-    char* str = new char[10];
-    sprintf(str, "%d", server->getDesktopSize().x);
-    return str;
-  }
-  if (strcmp(varName, "$APPLETHEIGHT") == 0) {
-    char* str = new char[10];
-    sprintf(str, "%d", server->getDesktopSize().y);
-    return str;
-  }
-  if (strcmp(varName, "$DESKTOP") == 0) {
-    return rfb::strDup(server->getName());
-  }
-  if (strcmp(varName, "$USER") == 0) {
-    char tempStr[256];  DWORD tempStrLen = 256;
-    GetUserName(tempStr, &tempStrLen);
-    return rfb::strDup(tempStr);
-  }
-  return 0;
-}
diff --git a/win/winvnc/JavaViewer.h b/win/winvnc/JavaViewer.h
deleted file mode 100644
index 79a3969..0000000
--- a/win/winvnc/JavaViewer.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
- * This is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this software; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
- * USA.
- */
-
-// -=- JavaViewer.h
-
-// Custom HTTPServer-derived class which serves the Java VNC Viewer
-// to clients, using resource files compiled in to the WinVNC executable.
-
-#ifndef WINVNC_JAVA_VIEWER
-#define WINVNC_JAVA_VIEWER
-
-#include <rfb/HTTPServer.h>
-#include <rdr/SubstitutingInStream.h>
-
-namespace winvnc {
-
-  class VNCServerWin32;
-
-  class JavaViewerServer : public rfb::HTTPServer, public rdr::Substitutor {
-  public:
-    JavaViewerServer(VNCServerWin32* desktop);
-    virtual ~JavaViewerServer();
-
-    virtual rdr::InStream* getFile(const char* name, const char** contentType,
-                                   int* contentLength, time_t* lastModified);
-
-    // rdr::Substitutor callback
-    virtual char* substitute(const char* varName);
-
-    void setRFBport(int port) {
-      rfbPort = port;
-    }
-  protected:
-    int rfbPort;
-    VNCServerWin32* server;
-  };
-
-};
-
-#endif
-
diff --git a/win/winvnc/VNCServerWin32.cxx b/win/winvnc/VNCServerWin32.cxx
index b164c65..9f6a954 100644
--- a/win/winvnc/VNCServerWin32.cxx
+++ b/win/winvnc/VNCServerWin32.cxx
@@ -42,8 +42,6 @@
 const TCHAR* winvnc::VNCServerWin32::RegConfigPath = _T("Software\\TigerVNC\\WinVNC4");
 
 
-static IntParameter http_port("HTTPPortNumber",
-  "TCP/IP port on which the server will serve the Java applet VNC Viewer ", 5800);
 static IntParameter port_number("PortNumber",
   "TCP/IP port on which the server will accept connections", 5900);
 static StringParameter hosts("Hosts",
@@ -63,8 +61,7 @@
       CreateEvent(0, FALSE, FALSE, "Global\\SessionEventTigerVNC") : 0),
     vncServer(CStr(ComputerName().buf), &desktop),
     thread_id(-1), runServer(false), isDesktopStarted(false),
-    httpServer(this), config(&sockMgr),
-    rfbSock(&sockMgr), httpSock(&sockMgr), trayIcon(0),
+    config(&sockMgr), rfbSock(&sockMgr), trayIcon(0),
     queryConnectDialog(0)
 {
   commandLock = new os::Mutex;
@@ -148,16 +145,10 @@
   // -=- Make sure we're listening on the right ports.
   rfbSock.setServer(&vncServer);
   rfbSock.setPort(port_number, localHost);
-  httpSock.setServer(&httpServer);
-  httpSock.setPort(http_port, localHost);
-
-  // -=- Update the Java viewer's web page port number.
-  httpServer.setRFBport(rfbSock.isListening() ? port_number : 0);
 
   // -=- Update the TCP address filter for both ports, if open.
   CharArray pattern(hosts.getData());
   rfbSock.setFilter(pattern.buf);
-  httpSock.setFilter(pattern.buf);
 
   // -=- Update the tray icon tooltip text with IP addresses
   processAddressChange();
diff --git a/win/winvnc/VNCServerWin32.h b/win/winvnc/VNCServerWin32.h
index ed051dc..271cb76 100644
--- a/win/winvnc/VNCServerWin32.h
+++ b/win/winvnc/VNCServerWin32.h
@@ -27,7 +27,6 @@
 #include <rfb_win32/SocketManager.h>
 #include <rfb_win32/TCharArray.h>
 #include <winvnc/QueryConnectDialog.h>
-#include <winvnc/JavaViewer.h>
 #include <winvnc/ManagedListener.h>
 
 namespace os {
@@ -78,10 +77,6 @@
 
     bool setClientsStatus(rfb::ListConnInfo* LCInfo);
 
-    // Used by JavaViewerServer
-    const char* getName() {return vncServer.getName();}
-    rfb::Point getDesktopSize() {return desktop.getFbSize();}
-
   protected:
     // VNCServerST::QueryConnectionHandler interface
     // Callback used to prompt user to accept or reject a connection.
@@ -121,12 +116,10 @@
     DWORD thread_id;
     bool runServer;
     bool isDesktopStarted;
-    JavaViewerServer httpServer;
     rfb::win32::SocketManager sockMgr;
     rfb::win32::RegConfig config;
 
     ManagedListener rfbSock;
-    ManagedListener httpSock;
     STrayIconThread* trayIcon;
 
     QueryConnectDialog* queryConnectDialog;
diff --git a/win/winvnc/index.vnc b/win/winvnc/index.vnc
deleted file mode 100644
index 560fa2e..0000000
--- a/win/winvnc/index.vnc
+++ /dev/null
@@ -1,22 +0,0 @@
-<!-- 
-     index.vnc - default HTML page for TigerVNC Java viewer applet, to be
-     used with WinVNC. On any file ending in .vnc, the HTTP server embedded in
-     WinVNC will substitute the following variables when preceded by a dollar:
-     USER, DESKTOP, APPLETWIDTH, APPLETHEIGHT, WIDTH, HEIGHT, PORT,
-     Use two dollar signs ($$) to get a dollar sign in the generated
-     HTML page.
--->
-
-<HTML>
-<TITLE>
-$USER's $DESKTOP desktop
-</TITLE>
-<APPLET CODE=com.tigervnc.vncviewer.VncViewer ARCHIVE=VncViewer.jar
-        WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
-<param name=PORT value=$PORT>
-<param name="Embed" value="true">
-<param name="draggable" value="true">
-</APPLET>
-<BR>
-<A href="http://www.tigervnc.org/">TigerVNC site</A>
-</HTML>
diff --git a/win/winvnc/resource.h b/win/winvnc/resource.h
index 68316be..0e52368 100644
--- a/win/winvnc/resource.h
+++ b/win/winvnc/resource.h
@@ -8,7 +8,6 @@
 #define IDD_DIALOG1                     103
 #define IDD_ABOUT                       104
 #define IDI_CONNECTED                   105
-#define IDR_VNCVIEWER_JAR               106
 #define IDD_QUERY_CONNECT               107
 #define IDD_ADD_NEW_CLIENT              108
 #define IDB_BITMAP                      109
diff --git a/win/winvnc/winvnc.rc.in b/win/winvnc/winvnc.rc
similarity index 96%
rename from win/winvnc/winvnc.rc.in
rename to win/winvnc/winvnc.rc
index 2b50966..44cb71c 100644
--- a/win/winvnc/winvnc.rc.in
+++ b/win/winvnc/winvnc.rc
@@ -217,18 +217,6 @@
 
 /////////////////////////////////////////////////////////////////////////////
 //
-// HTTPFILE
-//
-
-#cmakedefine BUILD_JAVA
-
-#ifdef BUILD_JAVA
-VNCVIEWER.JAR          HTTPFILE DISCARDABLE    "@VNCVIEWER_JAR_PATH@"
-INDEX.VNC              HTTPFILE DISCARDABLE    "@INDEX_VNC_PATH@"
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-//
 // 24
 //