%@ page import="java.io.File" %> <%@ page import="java.io.FileInputStream" %> <%@ page import="java.io.BufferedReader" %> <%@ page import="java.io.InputStreamReader" %> <%@ page import="java.util.Calendar" %> <% // Config variables. Extra-easy customization. // Consider entire source code customizable, just // these areas especially. // ================================================= // URL of this JSP page for purposes of refresh rate form. String URL = "http://ool-457b3126.dyn.optonline.net:8081/cam.jsp"; // Read title from disk or use static? // Default is load from disk. boolean diskTitle = true; String titleFileName = "/home/andrew/.camtitle"; String staticTitle = "Long Island, NY, Represent"; // Same as title setup except this is for the comment // underneath the date and cam image and we can // keep this one disabled completely boolean showComment = true; boolean diskComment = true; String commentFileName = "/home/andrew/.camcomment"; String staticComment = "The seclusion room"; // Should refresh rate be customizable? boolean customRefresh = true; int refreshRate = 5; // Show the date under the cam image? boolean showDate = true; // Log clients that connect to this site and // display list of current connections? boolean logHosts = true; // Where to store the logs! Make sure this exissts // and is a directory! String logDirectoryName = "/var/log/tomcat"; // Use xmms-infopipe plugin to show currently playing // music file? boolean showXMMS = true; // Customalizable link to user homepage. // First URL then link text. Leave null to omit. String homepageURL = "http://www.goodandpure.org"; String homepageText = "Andrew's Homepage"; %> <% String refreshString = request.getParameter("rate"); if (customRefresh && refreshString != null) { refreshRate = Integer.parseInt(refreshString); } %>
<% File titleFile = new File(titleFileName); if (diskTitle && titleFile.exists()) { FileInputStream fis = new FileInputStream(titleFile); InputStreamReader isr = new InputStreamReader(fis); BufferedReader reader = new BufferedReader(isr); String title; if ((title = reader.readLine()) != null) { out.print(title); reader.close(); isr.close(); fis.close(); } else { out.print(staticTitle); } } else { out.print(staticTitle); } %>
<% if(showDate) { %><%= new java.util.Date() %>
<% } if (showComment) { %><% File commentFile = new File(commentFileName); if (diskComment && commentFile.exists()) { FileInputStream fis = new FileInputStream(commentFile); InputStreamReader isr = new InputStreamReader(fis); BufferedReader reader = new BufferedReader(isr); String comment; if ((comment = reader.readLine()) != null) { out.print(comment); reader.close(); isr.close(); fis.close(); } else { out.print(staticComment); } } else { out.print(staticComment); } %>
<% } %>
|