Mercurial > hg > Members > nobuyasu > tightVNCProxy
changeset 32:015d43bb2b62
add CreateHtmlFile
author | e085711 |
---|---|
date | Wed, 27 Apr 2011 05:43:22 +0900 |
parents | cb0e4fd2d982 |
children | e44ffe36c514 |
files | src/myVncProxy/CreateHtmlFile.java |
diffstat | 1 files changed, 54 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/myVncProxy/CreateHtmlFile.java Wed Apr 27 05:43:22 2011 +0900 @@ -0,0 +1,54 @@ +package myVncProxy; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.PrintWriter; + +public class CreateHtmlFile { + + String header="<HTML><TITLE>hbpVNC desktop</TITLE>\n"; + String footer="<BR><A href=\"http://ie.u-ryukyu.ac.jp\"University of the Ryukyu </HTML>\n"; + + String host; + String user; + int port; + int width; + int height; + + File file; + + MyRfbProto rfb; + + CreateHtmlFile(MyRfbProto _rfb, String _host, String _user){ + rfb = _rfb; + host = _host; + user = _user; + port = rfb.getAcceptPort(); + width = rfb.framebufferWidth; + height = rfb.framebufferHeight; + + } + + void createHtml(){ + try{ +// String html_file = "/var/www/html/hbpVNC/"+ user +".html"; + String html_file = "./"+ user +".html"; + file = new File(html_file); + PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file))); + + String contents = "<APPLET CODE=\"VncViwer.class\" ARCHIVE=\"VncViewer.jar\"\n " + + "WIDTH=\""+width+"\" HEIGHT=\""+height+"\">\n"; + contents = contents+"<PARAM NAME=\"PORT\" VALUE=\""+port+"\">\n"; + contents = contents+"<PARAM NAME=\"HOST\" VALUE=\""+host+"\">\n"; + + pw.println(header+contents+footer); + pw.close(); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + +}