package org.sanju.log.reader;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

/**
 * @author Sanju Thomas
 */

public class WebLogReader{

	public static void main(final String[] args) throws URISyntaxException, IOException, InterruptedException {

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

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


@@ -70,20 +70,27 @@
 java.io.
-File
+IOException
 ;%0Aimport
@@ -98,20 +98,27 @@
 java.io.
-File
+InputStream
 Reader;%0A
@@ -125,38 +125,41 @@
 import java.
-io.IOException
+net.Authenticator
 ;%0Aimport jav
@@ -164,19 +164,38 @@
 ava.net.
-URI
+PasswordAuthentication
 ;%0Aimport
@@ -223,16 +223,37 @@
 ception;
+%0Aimport java.net.URL;
 %0A%0A/**%0A *
@@ -415,16 +415,214 @@
 eption %7B
+%0A%09%09%0A%09%09Authenticator.setDefault(new Authenticator()%7B%0A%09%09%09protected PasswordAuthentication getPasswordAuthentication()%7B%0A%09%09%09%09return new PasswordAuthentication(%22admin%22, %22admin%22.toCharArray());%0A%09%09%09%7D%0A%09%09%7D);
 %0A%0A%09%09Stri
@@ -799,17 +799,17 @@
 final UR
-I
+L
  uriObje
@@ -819,17 +819,17 @@
 = new UR
-I
+L
 (uri);%0A%09
@@ -906,37 +906,47 @@
 new 
-FileReader(new File(uriObject
+InputStreamReader(uriObject.openStream(
 )));
@@ -1162,11 +1162,10 @@
 %0A%09%09%7D%0A%09%7D%0A
+
 %7D%0A
-%0A

Update WebLogReader.java