<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to HttpNormalImpl</title><link>https://sourceforge.net/p/agendamovel/home/HttpNormalImpl/</link><description>Recent changes to HttpNormalImpl</description><atom:link href="https://sourceforge.net/p/agendamovel/home/HttpNormalImpl/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 27 Oct 2011 21:26:03 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/agendamovel/home/HttpNormalImpl/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage HttpNormalImpl modified by Gilberto</title><link>https://sourceforge.net/p/agendamovel/home/HttpNormalImpl/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,1 +1,56 @@
 &lt;a href='https://sourceforge.net/p/agendamovel/home/Home/'&gt;PAGINA INICIAL DO PROJETO&lt;/a&gt;
+package com.agenda.programa;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+
+public class HttpNormalImpl extends Http {
+	
+	public final String downloadArquivo(String url){
+
+		try{
+			
+			URL u = new URL(url);
+			HttpURLConnection conn = (HttpURLConnection)u.openConnection();
+			conn.setRequestMethod("GET");
+			conn.setDoInput(true);
+			conn.setDoOutput(false);
+			conn.connect();
+			
+			InputStream in = conn.getInputStream();
+			
+			String arquivo = readString(in);
+			conn.disconnect();
+			return arquivo;
+		}catch(Exception e){
+			return "erro: "+e;
+		}	
+	}
+
+	private String readString(InputStream in) throws IOException {
+		byte[] bytes = readBytes(in);
+		String texto = new String(bytes);
+		return texto;
+	}
+
+	private byte[] readBytes(InputStream in) throws IOException  {
+		ByteArrayOutputStream bos = new ByteArrayOutputStream();
+		try{
+			byte[] buffer = new byte[1024];
+			int len;
+			while((len = in.read(buffer))&gt;0){
+				bos.write(buffer,0,len);
+			}
+			byte[] bytes = bos.toByteArray();
+			return bytes;
+		}finally{
+			bos.close();
+			in.close();
+		}
+	}
+
+}
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gilberto</dc:creator><pubDate>Thu, 27 Oct 2011 21:26:03 -0000</pubDate><guid>https://sourceforge.netdb9d3934032019d99df263bdabdea2be0876b759</guid></item><item><title>WikiPage HttpNormalImpl modified by Gilberto</title><link>https://sourceforge.net/p/agendamovel/home/HttpNormalImpl/</link><description>&lt;a href='https://sourceforge.net/p/agendamovel/home/Home/'&gt;PAGINA INICIAL DO PROJETO&lt;/a&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Gilberto</dc:creator><pubDate>Thu, 27 Oct 2011 21:04:42 -0000</pubDate><guid>https://sourceforge.netb9937fe9e01ad67cfce8b0c3d06eeb302bf881e2</guid></item></channel></rss>