docs: def download(self, uuid, url, forced_file_name=None,
                   progress_bar=True, chunk_size=256,
                   directory=None, overwrite=False):
          """ download a file from LinShare using its rest api.
          This method could throw exceptions like urllib2.HTTPError."""
          self.last_req_time = None
          url = self.get_full_url(url)
          self.log.debug("download url : " + url)
          # Building request
          request = urllib2.Request(url)
          # request.add_header('Content-Type', 'application/json; charset=UTF-8')
          request.add_header('Accept', 'application/json,*/*;charset=UTF-8')
          # request start
          starttime = datetime.datetime.now()
          # doRequest
          resultq = urllib2.urlopen(request)
          code = resultq.getcode()
          file_name = uuid
          self.log.debug("ret code : '" + str(code) + "'")
          if code == 200:
              content_lenth = resultq.info().getheader('Content-Length')
              if not content_lenth:
                  msg = "No content lengh header found !"
                  self.log.debug(msg)
                  progress_bar = False
              else:
                  file_size = int(content_lenth.strip())
              if forced_file_name:
                  file_name = forced_file_name
              else:
                  content_dispo = resultq.info().getheader('Content-disposition')
                  if content_dispo:
                      content_dispo = content_dispo.strip()
                      file_name = extract_file_name(content_dispo)
              if directory:
                  if os.path.isdir(directory):
                      file_name = directory + "/" + file_name
              if os.path.isfile(file_name):
                  if not overwrite:
                      cpt = 1
                      while 1:
                          if not os.path.isfile(file_name + "." + str(cpt)):
                              file_name += "." + str(cpt)
                              break
                          cpt += 1
                  else:
                      self.log.warn("'%s' already exists. It was overwriten.",
                                    file_name)
              stream = None
              pbar = None
              if progress_bar:
                  widgets = [FileTransferSpeed(), ' <<<', Bar(), '>>> ',
                             Percentage(), ' ', ETA()]
                  pbar = ProgressBar(widgets=widgets, maxval=file_size)
                  stream = FileWithCallback(file_name, 'w', pbar.update,
                                            file_size, file_name)
                  pbar.start()
              else:
                  stream = file(file_name, 'w')
              while 1:
                  chunk = resultq.read(chunk_size)
                  if not chunk:
                      break
                  stream.write(chunk)
              stream.flush()
              stream.close()
              if pbar:
                  pbar.finish()
          # request end
          endtime = datetime.datetime.now()
          self.last_req_time = str(endtime - starttime)
          self.log.debug("download url : %(url)s : request time : %(time)s",
                         {"url": url,
                          "time": self.last_req_time})
          return (file_name, self.last_req_time)