1 import java.net.URL ; 2 import java.io.InputStream ; 3 4 public class GetURL { 5 6 public static void main( String argv[] ) throws Exception { 7 8 jcifs.Config.registerSmbURLHandler(); 9 10 URL url = new URL ( argv[0] ); 11 InputStream in = url.openStream(); 12 13 if( in != null ) { 14 byte[] buf = new byte[4096]; 15 int n; 16 while(( n = in.read( buf )) != -1 ) { 17 System.out.write( buf, 0, n ); 18 } 19 } else { 20 System.out.println( "stream waz null" ); 21 } 22 in.close(); 23 } 24 } 25 26 | Popular Tags |