From: Constantin Kaplinsky Date: Sun, 22 Sep 2002 08:36:43 +0000 (+0000) Subject: Allowing relative URLs as values for the "URL" parameter, in the X-Git-Tag: v0.0.90~497 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=40ad1714c5555aca3bff60aeb75cd2cbb64ac8c3;p=tigervnc.git Allowing relative URLs as values for the "URL" parameter, in the applet mode. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2524 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/java/src/com/tightvnc/rfbplayer/README b/java/src/com/tightvnc/rfbplayer/README index a021ca48..54975207 100644 --- a/java/src/com/tightvnc/rfbplayer/README +++ b/java/src/com/tightvnc/rfbplayer/README @@ -17,10 +17,11 @@ Applet Parameters Value: URL of the session file to play. Default: none (required parameter). - This parameter tells the player which session file to play. Please note - that if the player operates as an unsigned applet, it is able to play - only files from the host where the applet was loaded from. It's a usual - JVM security limitation. + This parameter tells the player which session file to play. The URL can + be either a complete one (e.g. "file:/your/path/session.fbs") or relative + (e.g. "session.fbs"). Please note that if the player operates as an + unsigned applet, it is able to play only files from the host where the + applet was loaded from. It's a usual JVM security limitation. --> "Position" diff --git a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java index 32568047..0a7838c1 100644 --- a/java/src/com/tightvnc/rfbplayer/RfbPlayer.java +++ b/java/src/com/tightvnc/rfbplayer/RfbPlayer.java @@ -120,7 +120,11 @@ public class RfbPlayer extends java.applet.Applet } try { - url = new URL(sessionURL); + if (inAnApplet) { + url = new URL(getCodeBase(), sessionURL); + } else { + url = new URL(sessionURL); + } rfb = new RfbProto(url); vc = new VncCanvas(this); diff --git a/java/src/com/tightvnc/rfbplayer/index.html b/java/src/com/tightvnc/rfbplayer/index.html index f5e0eea0..303bc5d2 100644 --- a/java/src/com/tightvnc/rfbplayer/index.html +++ b/java/src/com/tightvnc/rfbplayer/index.html @@ -3,7 +3,7 @@ - +