public static InputStream streamFromString(String location) throws IOException {
  InputStream is=null;
  URL url=urlFromString(location,null,false);
  if (url != null) {
    is=url.openStream();
  }
 else {
    File f=new File(location);
    if (f.exists())     is=new FileInputStream(f);
  }
  if (is == null) {
    return null;
  }
 else   if (isGZipFile(location)) {
    return new GZIPInputStream(is);
  }
 else {
    return is;
  }
}

public static InputStream streamFromString ( String location ) throws IOException { InputStream is = null ; URL url = urlFromString ( location , null , false ) ; if ( url != null ) { is = url . openStream ( ) ; } else { File f = new File ( location ) ; if ( f . exists ( ) ) is = new FileInputStream ( f ) ; } if ( is == null ) { return null ; } else if ( isGZipFile ( location ) ) { return new GZIPInputStream ( is ) ; } else { return is ; } }
get an input string corresponding to the given location string . the string will first be resolved to a url and an input stream will be requested from the url connection . if this fails , the location will be resolved against the file system . also , if a gzip file is found , the input stream will also be wrapped by a gzipinputstream . if the location string can not be resolved , a null value is returned
