1 46 47 package org.codehaus.groovy.control.io; 48 49 import java.io.IOException ; 50 import java.io.InputStreamReader ; 51 import java.io.Reader ; 52 import java.net.URL ; 53 54 import org.codehaus.groovy.control.CompilerConfiguration; 55 56 57 64 65 public class URLReaderSource extends AbstractReaderSource 66 { 67 70 private URL url; 72 73 76 77 public URLReaderSource( URL url, CompilerConfiguration configuration ) 78 { 79 super( configuration ); 80 this.url = url; 81 } 82 83 84 85 88 89 public Reader getReader() throws IOException 90 { 91 return new InputStreamReader ( url.openStream(), configuration.getSourceEncoding() ); 92 } 93 94 95 96 97 } 98 | Popular Tags |