code: def download(self, callback=None):
          
          dirPath = self.localDirPath
          if not os.path.exists(dirPath):
              tempDirPath = mkdtemp(dir=os.path.dirname(dirPath), prefix=self.contentHash + "-")
              self._save(tempDirPath)
              if callback is not None:
                  callback(tempDirPath)
              try:
                  os.rename(tempDirPath, dirPath)
              except OSError as e:
                  # If dirPath already exists & is non-empty either ENOTEMPTY or EEXIST will be raised
                  if e.errno == errno.ENOTEMPTY or e.errno == errno.EEXIST:
                      # Another process beat us to it.
                      # TODO: This is correct but inefficient since multiple processes download the resource redundantly
                      pass
                  else:
                      raise
docs: Downloads this resource from its URL to a file on the local system. This method should
          only be invoked on a worker node after the node was setup for accessing resources via
          prepareSystem().