title: Saving image from url using Picasso?
body: <p>I'm trying save an image using API Picasso. To do it I'm trying use <code>Target</code> to save but I can't do this work.</p>
  
  <p>How could I do this ?</p>
  
  <p>Trying</p>
  
  <pre><code>//save image
      public static void imageDownload(Context ctx){
          Picasso.with(ctx)
                  .load("http://blog.concretesolutions.com.br/wp-content/uploads/2015/04/Android1.png")
                  .into(getTarget("http://blog.concretesolutions.com.br/wp-content/uploads/2015/04/Android1.png"));
      }
  
      //target to save
      private static Target getTarget(final String url){
          Target target = new Target(){
  
              @Override
              public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) {
                  new Thread(new Runnable() {
                      @Override
                      public void run() {
                          //Log.i("PRODUTOS_FOLDER", CreateAppFolder.getProdutosFolder());
                          File file = new File(Environment.getExternalStorageDirectory() + url);
  
                          try {
                              file.createNewFile();
                              FileOutputStream ostream = new FileOutputStream(file);
                              bitmap.compress(Bitmap.CompressFormat.JPEG, 100, ostream);
                              ostream.flush();
                              ostream.close();
                          }
                          catch (Exception e) {
                              e.printStackTrace();
                          }
                      }
                  }).start();
  
              }
  
              @Override
              public void onBitmapFailed(Drawable errorDrawable) {
  
              }
  
              @Override
              public void onPrepareLoad(Drawable placeHolderDrawable) {
  
              }
          };
          return target;
      }
  </code></pre>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>java.io.IOException: open failed: ENOENT (No such file or directory)
  </code></pre>