src/org/sonews/util/io/Resource.java
changeset 75 41d6c0cac8b3
parent 37 74139325d305
     1.1 --- a/src/org/sonews/util/io/Resource.java	Sun Aug 29 18:17:37 2010 +0200
     1.2 +++ b/src/org/sonews/util/io/Resource.java	Thu Oct 13 03:09:22 2011 +0200
     1.3 @@ -19,6 +19,8 @@
     1.4  package org.sonews.util.io;
     1.5  
     1.6  import java.io.BufferedReader;
     1.7 +import java.io.File;
     1.8 +import java.io.FileInputStream;
     1.9  import java.io.IOException;
    1.10  import java.io.InputStream;
    1.11  import java.io.InputStreamReader;
    1.12 @@ -59,6 +61,10 @@
    1.13  		try {
    1.14  			URL url = getAsURL(name);
    1.15  			if (url == null) {
    1.16 +				File file = new File(name);
    1.17 +				if(file.exists()) {
    1.18 +					return new FileInputStream(file);
    1.19 +				}
    1.20  				return null;
    1.21  			} else {
    1.22  				return url.openStream();