@@ -0,0 +1,1477 @@
+package org.qiaoer.photogallery;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.net.HttpURLConnection;%0Aimport java.net.URL;%0A%0A%0Apublic class FlickerFetcher %7B%0A    byte%5B%5D getUrlBytes(String urlSpec) throws IOException %7B%0A        HttpURLConnection connection = null;%0A        ByteArrayOutputStream out = null;%0A        InputStream inputStream = null;%0A        try %7B%0A            URL url = new URL(urlSpec);%0A            connection = (HttpURLConnection) url.openConnection();%0A%0A            out = new ByteArrayOutputStream();%0A            inputStream = connection.getInputStream();%0A            if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) %7B%0A                return null;%0A            %7D%0A            int hasRead = 0;%0A            byte%5B%5D buffer = new byte%5B1024%5D;%0A            while ((hasRead = inputStream.read(buffer)) %3E 0) %7B%0A                out.write(buffer, 0, hasRead);%0A            %7D%0A%0A            out.close();%0A            return out.toByteArray();%0A        %7D finally %7B%0A            connection.disconnect();%0A            try %7B%0A                if (out != null) %7B%0A                    out.close();%0A                %7D%0A%0A                if (inputStream != null)%0A                    inputStream.close();%0A            %7D catch (IOException e) %7B%0A                e.printStackTrace();%0A            %7D%0A        %7D%0A    %7D%0A%0A    public String getUrl(String urlSpec) throws IOException %7B%0A        return new String(getUrlBytes(urlSpec));%0A    %7D%0A%7D%0A

add FlickerFetcher.java as a tool class to handle internet connection