To answer the question of how to get the full url, my work around was
to use conn.getURL() instead of the passed URI.  So it would be:

        public CacheRequest put(URI uri, URLConnection conn) throws
IOException {
                // TODO Auto-generated method stub
                Log.i("DataLoader", "Put() " + conn.getURL);
                return null;
        }

On Sep 18, 5:43 pm, Matt Kanninen <[email protected]> wrote:
> I am seeing the same thing.
>
> On Aug 3, 12:27 am, Guitou <[email protected]> wrote:
>
> > Hi,
> > I extended ResponseCache as follow :
>
> > public class DataLoader extends ResponseCache {
>
> >         @Override
> >         public CacheResponse get(URI uri, String arg1,
> >                         Map<String, List<String>> arg2) throws IOException {
> >                 // TODO Auto-generated method stub
> >                 Log.i("DataLoader", "Get()" + uri);
> >                 return null;
> >         }
>
> >         @Override
> >         public CacheRequest put(URI uri, URLConnection conn) throws
> > IOException {
> >                 // TODO Auto-generated method stub
> >                 Log.i("DataLoader", "Put()" + uri);
> >                 return null;
> >         }
>
> > }
>
> > I use this code to retrieve datas :
>
> >                 ResponseCache.setDefault(new DataLoader());
> >                 URI uri;
> >                 HttpURLConnection conn;
> >                 try {
> >                         uri = new 
> > URI("http://www.google.com/intl/en_ALL/images/logo.gif";);
> >                         conn = 
> > (HttpURLConnection)uri.toURL().openConnection();
> >                         InputStream inputStream;
> >                         inputStream = conn.getInputStream();
> >                         inputStream.close();
> >                 } catch (MalformedURLException e1) {
> >                         // TODO Auto-generated catch block
> >                         e1.printStackTrace();
> >                 } catch (IOException e1) {
> >                         // TODO Auto-generated catch block
> >                         e1.printStackTrace();
> >                 } catch (URISyntaxException e1) {
> >                         // TODO Auto-generated catch block
> >                         e1.printStackTrace();
> >                 }
>
> > But when I look to my logs, the URI sent to the get() method is good
> > (http://www.google.com/intl/en_ALL/images/logo.gif) but in the put()
> > it does not give me the same URI but onlyhttp://www.google.com
> > Is that normal?
> > How to get the full url in put() ?
> > Thanks for your help!
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to