code: func (c *Client) UploadDirectory(dir, defaultPath, manifest string, toEncrypt bool) (string, error) {
  	stat, err := os.Stat(dir)
  	if err != nil {
  		return "", err
  	} else if !stat.IsDir() {
  		return "", fmt.Errorf("not a directory: %s", dir)
  	}
  	if defaultPath != "" {
  		if _, err := os.Stat(filepath.Join(dir, defaultPath)); err != nil {
  			if os.IsNotExist(err) {
  				return "", fmt.Errorf("the default path %q was not found in the upload directory %q", defaultPath, dir)
  			}
  			return "", fmt.Errorf("default path: %v", err)
  		}
  	}
  	return c.TarUpload(manifest, &DirectoryUploader{dir}, defaultPath, toEncrypt)
  }
docs: // UploadDirectory uploads a directory tree to swarm and either adds the files
  // to an existing manifest (if the manifest argument is non-empty) or creates a
  // new manifest, returning the resulting manifest hash (files from the
  // directory will then be available at bzz:/<hash>/path/to/file), with
  // the file specified in defaultPath being uploaded to the root of the manifest
  // (i.e. bzz:/<hash>/)