]> source.dussan.org Git - tigervnc.git/commitdiff
HTTP access to session files implemented.
authorConstantin Kaplinsky <const@tightvnc.com>
Sat, 25 May 2002 09:49:23 +0000 (09:49 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Sat, 25 May 2002 09:49:23 +0000 (09:49 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2506 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tightvnc/rfbplayer/README
java/src/com/tightvnc/rfbplayer/RfbPlayer.java

index 1d4c9c6fc7e3003b66c13286c4eebf16ce06d24e..4a3a72eac52e5f81381e0ce6f633012bfad7e6e4 100644 (file)
@@ -1,12 +1,13 @@
 
-RFB Session Player 0.1.0
+RFB Session Player 0.7.0
 ========================
 
 RFB Session Player is a Java application/applet for playing back RFB
 session files in FBS format saved by such programs as VNC Reflector or
 rfbproxy.
 
-Usage:  java RfbPlayer FILE test.fbs
+Usage:  java RfbPlayer URL file:test.fbs
+        java RfbPlayer URL http://remote.host/sessions/test.fbs
 
 
 Licensing Terms
index 4a9bc2fe9e53ff35f290cadca9b1d2d040bd5cd7..58d4d640a832ea40d57ed76b94a92667ccd317ed 100644 (file)
@@ -21,6 +21,7 @@
 import java.awt.*;
 import java.awt.event.*;
 import java.io.*;
+import java.net.*;
 
 public class RfbPlayer extends java.applet.Applet
   implements java.lang.Runnable, WindowListener {
@@ -62,7 +63,7 @@ public class RfbPlayer extends java.applet.Applet
   ButtonPanel buttonPanel;
   VncCanvas vc;
 
-  String sessionFileName;
+  String sessionURL;
   boolean showControls;
   int deferScreenUpdates;
 
@@ -122,8 +123,8 @@ public class RfbPlayer extends java.applet.Applet
     }
 
     try {
-      FileInputStream file = new FileInputStream(sessionFileName);
-      fbsStream = new FbsInputStream(file);
+      URL url = new URL(sessionURL);
+      fbsStream = new FbsInputStream(url.openStream());
       rfb = new RfbProto(fbsStream);
 
       vc = new VncCanvas(this);
@@ -165,9 +166,8 @@ public class RfbPlayer extends java.applet.Applet
          buttonPanel.setMode(MODE_STOPPED);
          vc.processNormalProtocol();
        } catch (EOFException e) {
-         file.close();
-         file = new FileInputStream(sessionFileName);
-         fbsStream = new FbsInputStream(file);
+         fbsStream.close();
+         fbsStream = new FbsInputStream(url.openStream());
          rfb.newInputStream(fbsStream);
        }
       }
@@ -203,7 +203,7 @@ public class RfbPlayer extends java.applet.Applet
 
   public void readParameters() {
 
-    sessionFileName = readParameter("FILE", true);
+    sessionURL = readParameter("URL", true);
 
     showControls = true;
     String str = readParameter("Show Controls", false);