package com.github.alexvictoor.livereload;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;

public class FileReader {

    public String readFileFromClassPath(String classPath) {
        try {
            URL resource = getClass().getResource(classPath);
            if (resource==null) {
                throw new IllegalArgumentException("Incorrect path file");
            }
            URI fileURI = resource.toURI();
            byte[] encoded = Files.readAllBytes(Paths.get(fileURI));
            return new String(encoded, Charset.defaultCharset());
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
    }
}

@@ -48,27 +48,75 @@
 ort 
-java.io.IOException
+org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.io.*
 ;%0Aim
@@ -279,16 +279,42 @@
 e.Paths;
+%0Aimport java.util.Scanner;
 %0A%0Apublic
@@ -334,16 +334,100 @@
 ader %7B%0A%0A
+    public static final Logger logger = LoggerFactory.getLogger(FileReader.class);%0A%0A
     publ
@@ -482,49 +482,41 @@
 ) %7B%0A
-        try %7B%0A            URL resource = 
+%0A%0A            return new Scanner(
 getC
@@ -533,16 +533,24 @@
 Resource
+AsStream
 (classPa
@@ -556,173 +556,34 @@
 ath)
-;%0A            if (resource==null) %7B%0A                throw new IllegalArgumentException(%22Incorrect path file%22);%0A            %7D%0A            URI fileURI = resource.toURI
+).useDelimiter(%22%5C%5CZ%22).next
 ();%0A
@@ -594,16 +594,18 @@
         
+//
 byte%5B%5D e
@@ -657,32 +657,34 @@
 ));%0A            
+//
 return new Strin
@@ -725,178 +725,8 @@
 ));%0A
-        %7D catch (IOException e) %7B%0A            throw new RuntimeException(e);%0A        %7D catch (URISyntaxException e) %7B%0A            throw new RuntimeException(e);%0A        %7D
 %0A   

Fix filereader to allow reading from jar file