package org.sanju.log.reader;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * @author Sanju Thomas
 */

public class WebLogReader{

	public static void main(final String[] args) throws URISyntaxException, IOException, InterruptedException {
		
		Authenticator.setDefault(new Authenticator(){
			protected PasswordAuthentication getPasswordAuthentication(){
				return new PasswordAuthentication("admin", "admin".toCharArray());
			}
		});

		String uri = null;
		if(args.length == 1){
			uri = args[0];
		}else{
			System.out.println("Usage : org.sanju.log.streamer.WebLogReader <<URL>>");
			System.exit(0);
		}

		final URL uriObject = new URL(uri);
		BufferedReader reader = null;
		try {
			reader = new BufferedReader(new InputStreamReader(uriObject.openStream()));
			while(true){
				final String line = reader.readLine();
				if(null == line){
					Thread.sleep(1000);
				}
				System.out.println(line);
			}
		} finally{
			if(null != reader) {
				reader.close();
			}
		}
	}
}

@@ -304,16 +304,17 @@
 ogReader
+ 
 %7B%0A%0A%09publ
@@ -417,18 +417,16 @@
 ption %7B%0A
-%09%09
 %0A%09%09Authe
@@ -464,16 +464,17 @@
 icator()
+ 
 %7B%0A%09%09%09pro
@@ -530,16 +530,17 @@
 cation()
+ 
 %7B%0A%09%09%09%09re
@@ -641,16 +641,17 @@
 ll;%0A%09%09if
+ 
 (args.le
@@ -660,16 +660,17 @@
 th == 1)
+ 
 %7B%0A%09%09%09uri
@@ -688,12 +688,14 @@
 %0A%09%09%7D
+ 
 else
+ 
 %7B%0A%09%09
@@ -963,14 +963,16 @@
 hile
+ 
 (true)
+ 
 %7B%0A%09%09
@@ -1014,24 +1014,25 @@
 ne();%0A%09%09%09%09if
+ 
 (null == lin
@@ -1033,16 +1033,17 @@
 == line)
+ 
 %7B%0A%09%09%09%09%09T
@@ -1066,17 +1066,25 @@
 );%0A%09%09%09%09%7D
-%0A
+ else %7B%0A%09
 %09%09%09%09Syst
@@ -1105,16 +1105,22 @@
 (line);%0A
+%09%09%09%09%7D%0A
 %09%09%09%7D%0A%09%09%7D
@@ -1131,15 +1131,17 @@
 ally
+ 
 %7B%0A%09%09%09if
+ 
 (nul

Update WebLogReader.java